SSPkrolik / nimongo

Pure Nim lang MongoDB driver
http://sspkrolik.github.io/nimongo
MIT License
101 stars 20 forks source link

Implement locking in more idiomatic nim style by checking for the threads:on flag at compile time #75

Closed rayman22201 closed 4 years ago

rayman22201 commented 4 years ago

See here for more details: https://github.com/nim-lang/Nim/issues/12330

TLDR; Checking the threads:on flag is more idiomatic than forcing the include of -pthreads on Linux.

By making use of the threads:on flag, the proper thread libraries (and associated lock implementation), will be included for all supported nim platforms automatically.

I have also modified the test suite to test with both threads:on and no threads.

/cc @timotheecour This change passes the included test suite for me locally, but I don't use mongodb myself. Can you test this PR on your code to make it sure it works for a real world application? Feel free to make any code review or other suggestions as well. 😄

rayman22201 commented 4 years ago

ping @timotheecour and @SSPkrolik

Any thoughts or updates on this?

timotheecour commented 4 years ago

ping @SSPkrolik