-
-
Notifications
You must be signed in to change notification settings - Fork 422
fix Issue 13416 - dead-lock in FreeBSD suspend handler #1061
Conversation
- use pthread internal THR_IN_CRITICAL to retry suspend
|
This is for you @braddr :) |
|
I'd love to merge (having just deprecated one of those freebsd tests that hung), but I'm afraid I am not qualified to review :) The inter-thread communication looks simple enough, and correct to me. The major concern I have on this is that you are relying on pthread implementation details. Is there any way to static assert or assert(0) at runtime when those change? |
None that I know of other than to explicitly check for FreeBSD versions. |
pthread_t is an opaque object, it can be changed without breaking binary compatibility. Any idea if they would accept a request to add the |
It does change the internal ABI. It's not a kernel struct AFAIK, but changing it would still require any binary code that uses thr_private to be changed. And they wouldn't have a good reason to change the beginning of that struct.
THR_IN_CRITICAL a primitive from their library.
Sounds nice, we could even add C code to fetch the values, I think I tried that and it wasn't possible to include that header, not sure right now. It would only partly solve our problem, we'd then have to make 2 releases compiled against different versions of FBSD. |
I like this plan. |
It's not possible, the header doesn't exist outside of libthr. |
|
OK, then I guess we do what we have to. I think you are probably correct in that it won't change.
Can you add a warning in the comment for Other than that, LGTM. |
Done, can't hurt to add a few lines, even though there already is the git history and I used the literal name of that macro. |
|
Nice, thanks. LGTM. |
Added one more commit. Can you please merge it afterwards? |
|
Auto-merge toggled on |
fix Issue 13416 - dead-lock in FreeBSD suspend handler
|
Might as well, I think the best way to get this going is to merge and see if anything bad happens :) |
Issue 13416