[sheepdog] quesiton about function worker_routine() in lib/work.c

Bingpeng Zhu nkuzbp at foxmail.com
Wed Sep 3 11:37:19 CEST 2014


Hi, all
   I am reading sheepdog's source code. I have a question of the code in function worker_routine() in  lib/work.c. 
It calls sd_mutex_lock(&wi->startup_lock)  in the beginning , and calls  sd_mutex_unlock(&wi->startup_lock) ‍
immediately after the lock. It seems that the code want to block the new threads until all the new threads are created.
I don't understand the purpose for doing this.  Can anybody answer my question?


Thanks
Bingpeng
‍
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20140903/63163cfc/attachment-0003.html>


More information about the sheepdog mailing list