@@ -1260,6 +1260,7 @@ void do_run_timeout(void *data) {
12601260
12611261 unsigned long * timeout_data = data ;
12621262
1263+ acquire_eval_lock ();
12631264 JSValueRef args [1 ];
12641265 args [0 ] = JSValueMakeNumber (ctx , (double )* timeout_data );
12651266 free (timeout_data );
@@ -1269,7 +1270,6 @@ void do_run_timeout(void *data) {
12691270 run_timeout_fn = get_function ("global" , "PLANCK_RUN_TIMEOUT" );
12701271 JSValueProtect (ctx , run_timeout_fn );
12711272 }
1272- acquire_eval_lock ();
12731273 JSObjectCallAsFunction (ctx , run_timeout_fn , NULL , 1 , args , NULL );
12741274 release_eval_lock ();
12751275}
@@ -1310,6 +1310,7 @@ void do_run_interval(void *data) {
13101310
13111311 unsigned long * interval_data = data ;
13121312
1313+ acquire_eval_lock ();
13131314 JSValueRef args [1 ];
13141315 args [0 ] = JSValueMakeNumber (ctx , (double )* interval_data );
13151316 free (interval_data );
@@ -1319,7 +1320,7 @@ void do_run_interval(void *data) {
13191320 run_interval_fn = get_function ("global" , "PLANCK_RUN_INTERVAL" );
13201321 JSValueProtect (ctx , run_interval_fn );
13211322 }
1322- acquire_eval_lock ();
1323+
13231324 JSObjectCallAsFunction (ctx , run_interval_fn , NULL , 1 , args , NULL );
13241325 release_eval_lock ();
13251326}
@@ -1378,6 +1379,7 @@ conn_data_cb_ret_t *socket_conn_data_arrived(char *data, int sock, void *info) {
13781379
13791380 data_arrived_info_t * data_arrived_info = info ;
13801381
1382+ acquire_eval_lock ();
13811383 JSValueRef args [2 ];
13821384 args [0 ] = JSValueMakeNumber (ctx , sock );
13831385
@@ -1388,7 +1390,6 @@ conn_data_cb_ret_t *socket_conn_data_arrived(char *data, int sock, void *info) {
13881390 args [1 ] = JSValueMakeNull (ctx );
13891391 }
13901392
1391- acquire_eval_lock ();
13921393 JSObjectCallAsFunction (ctx , data_arrived_info -> data_arrived_cb , NULL , 2 , args , NULL );
13931394 release_eval_lock ();
13941395
@@ -1408,16 +1409,16 @@ accepted_conn_cb_ret_t *accepted_socket_connection(int sock, void *info) {
14081409
14091410 accept_info_t * accept_info = info ;
14101411
1412+ acquire_eval_lock ();
14111413 JSValueRef args [1 ];
14121414 args [0 ] = JSValueMakeNumber (ctx , sock );
14131415
1414- acquire_eval_lock ();
14151416 JSValueRef data_arrived_cb_ref = JSObjectCallAsFunction (ctx , accept_info -> accept_cb , NULL , 1 , args , NULL );
1416- release_eval_lock ();
14171417
14181418 data_arrived_info_t * data_arrived_info = malloc (sizeof (data_arrived_info_t ));
14191419 data_arrived_info -> data_arrived_cb = JSValueToObject (ctx , data_arrived_cb_ref , NULL );
14201420 JSValueProtect (ctx , data_arrived_cb_ref );
1421+ release_eval_lock ();
14211422
14221423 accepted_conn_cb_ret_t * accepted_conn_cb_ret = malloc (sizeof (accepted_conn_cb_ret_t ));
14231424
0 commit comments