Skip to content

Commit

Permalink
Fix driver locking on R16B
Browse files Browse the repository at this point in the history
See this thread for further details (as well as nice explanation from @jlouis):

Vagabond/erlang-syslog#9

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information
lemenkov committed May 16, 2013
1 parent 063c021 commit c3eef51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c_src/erlsyslog_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static ErlDrvEntry syslogdrv_driver_entry = {
ERL_DRV_EXTENDED_MARKER,
ERL_DRV_EXTENDED_MAJOR_VERSION,
ERL_DRV_EXTENDED_MINOR_VERSION,
0,
ERL_DRV_FLAG_USE_PORT_LOCKING,
NULL,
NULL,
NULL,
Expand Down

1 comment on commit c3eef51

@jlouis
Copy link

@jlouis jlouis commented on c3eef51 May 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is what is the thing to do. But please make sure you are only reading in the callbacks and not updating stuff in a way that is not thread-safe. Earlier, we could rely on only having one worker in the driver callback code at a time due to a giant lock around it. But we can't now, so extra care has to be taken.

I agree, however, that this is the needed way around the problem.

Please sign in to comment.