attractivechaos / klib

A standalone and lightweight C library
http://attractivechaos.github.io/klib/
MIT License
4.18k stars 556 forks source link

Can kdq_shift be called without locking thread? #142

Closed 7PintsOfCherryGarcia closed 4 years ago

7PintsOfCherryGarcia commented 4 years ago

My working threads get data from kdq until a NULL pointer is obtained.

Is calling kdq_shift on the same queue across multiple threads safe? Or would it be advisable to lock beforehand?

attractivechaos commented 4 years ago

kdq_shift is not thread safe, unfortunately. You have to lock this call.

7PintsOfCherryGarcia commented 4 years ago

Perfect, thanks!!