Skip to content

Commit

Permalink
agent_scripting: race fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
polakovic committed Jan 25, 2022
1 parent 33720d3 commit 8ae90de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions indigo_drivers/agent_scripting/indigo_agent_scripting.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,7 @@ static indigo_result agent_device_attach(indigo_device *device) {
pthread_mutexattr_init(&Attr);
pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&PRIVATE_DATA->mutex, &Attr);
PRIVATE_DATA->ctx = duk_create_heap_default();
if (PRIVATE_DATA->ctx) {
if ((PRIVATE_DATA->ctx = duk_create_heap_default())) {
pthread_mutex_lock(&PRIVATE_DATA->mutex);
duk_push_c_function(PRIVATE_DATA->ctx, error_message, 1);
duk_put_global_string(PRIVATE_DATA->ctx, "indigo_error");
Expand Down

0 comments on commit 8ae90de

Please sign in to comment.