@@ -189,7 +189,7 @@ typedef struct {
189
189
PyObject_HEAD
190
190
191
191
// Are there threads waiting for items
192
- uint8_t threads_waiting ;
192
+ bool has_threads_waiting ;
193
193
194
194
// Items in the queue
195
195
RingBuf buf ;
@@ -276,7 +276,7 @@ maybe_unparked_thread(HandoffData *data, PyObject **item, int has_more_waiters)
276
276
* item = data -> item ;
277
277
data -> handed_off = 1 ;
278
278
}
279
- data -> queue -> threads_waiting = has_more_waiters ;
279
+ data -> queue -> has_threads_waiting = has_more_waiters ;
280
280
}
281
281
282
282
/*[clinic input]
@@ -303,9 +303,9 @@ _queue_SimpleQueue_put_impl(simplequeueobject *self, PyObject *item,
303
303
.item = Py_NewRef (item ),
304
304
.queue = self ,
305
305
};
306
- if (self -> threads_waiting ) {
306
+ if (self -> has_threads_waiting ) {
307
307
// Try to hand the item off directly if there are threads waiting
308
- _PyParkingLot_Unpark (& self -> threads_waiting ,
308
+ _PyParkingLot_Unpark (& self -> has_threads_waiting ,
309
309
(_Py_unpark_fn_t * )maybe_unparked_thread , & data );
310
310
}
311
311
if (!data .handed_off ) {
@@ -407,11 +407,11 @@ _queue_SimpleQueue_get_impl(simplequeueobject *self, PyTypeObject *cls,
407
407
}
408
408
409
409
uint8_t waiting = 1 ;
410
- self -> threads_waiting = waiting ;
410
+ self -> has_threads_waiting = waiting ;
411
411
412
412
PyObject * item = NULL ;
413
- int st = _PyParkingLot_Park (& self -> threads_waiting , & waiting ,
414
- sizeof (uint8_t ), timeout_ns , & item ,
413
+ int st = _PyParkingLot_Park (& self -> has_threads_waiting , & waiting ,
414
+ sizeof (bool ), timeout_ns , & item ,
415
415
/* detach */ 1 );
416
416
switch (st ) {
417
417
case Py_PARK_OK : {
0 commit comments