wahern / cqueues

Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.
http://25thandclement.com/~william/projects/cqueues.html
MIT License
244 stars 37 forks source link

add thread:setname and thread:getname #208

Open slact opened 5 years ago

slact commented 5 years ago

Adds wrappers for pthread_setname_np and pthread_getname_np to the thread metatable. It's quite useful to be able to name long-running threads!

daurnimator commented 5 years ago

Is pthread_setname_np available on all cqueues supported platforms? (an _np suffix usually means "non-posix", which means that the function is not well supported)

Some quick googling suggests:

slact commented 5 years ago

Oh, you're right, that's quite a mess. I've added checks to explicitly support the relevant functions on Linux, the BSDs and OS X.