@@ -96,8 +96,6 @@ static u8_t ring_buf_initialized = 1;
96
96
97
97
#ifdef ZJS_LINUX_BUILD
98
98
#define k_is_preempt_thread () 0
99
- #define irq_lock () 0
100
- #define irq_unlock (key ) do {} while (0);
101
99
#define RB_LOCK () do {} while (0)
102
100
#define RB_UNLOCK () do {} while (0)
103
101
#define CB_LOCK () do {} while (0)
@@ -397,7 +395,9 @@ void signal_callback_priv(zjs_callback_id id,
397
395
args , size );
398
396
#endif
399
397
int in_thread = k_is_preempt_thread (); // versus ISR or co-op thread
398
+ #ifndef ZJS_LINUX_BUILD
400
399
int key = 0 ;
400
+ #endif
401
401
if (in_thread ) CB_LOCK ();
402
402
if (id < 0 || id >= cb_size || !cb_map [id ]) {
403
403
DBG_PRINT ("callback ID %d does not exist\n" , id );
@@ -420,10 +420,12 @@ void signal_callback_priv(zjs_callback_id id,
420
420
#ifdef INSTRUMENT_CALLBACKS
421
421
set_info_string (cb_map [id ]-> caller , file , func );
422
422
#endif
423
+ #ifndef ZJS_LINUX_BUILD
423
424
if (in_thread ) {
424
425
RB_LOCK ();
425
426
key = irq_lock ();
426
427
}
428
+ #endif
427
429
int ret = zjs_port_ring_buf_put (& ring_buffer ,
428
430
(u16_t )id ,
429
431
0 , // we use value for CB_FLUSH_ONE/ALL
@@ -434,11 +436,11 @@ void signal_callback_priv(zjs_callback_id id,
434
436
// rather than locking everything, as we are only trying to prevent a
435
437
// callback
436
438
// from being edited and called at the same time.
439
+ #ifndef ZJS_LINUX_BUILD
437
440
if (in_thread ) {
438
441
irq_unlock (key );
439
442
RB_UNLOCK ();
440
443
}
441
- #ifndef ZJS_LINUX_BUILD
442
444
zjs_loop_unblock ();
443
445
#endif
444
446
if (ret != 0 ) {
0 commit comments