Repository navigation
Add optional count argument to Semaphore::post - #93605
Conversation
0076121 to
96f75a8
Compare
Semaphore::post
|
May I ask in what occasion would this be useful? It is a relatively innocent change, but it's still worth knowing why it would need to be done. |
|
It's just so you dont have to do a for loop anymore to resume more and more threads, and it would be way more optimized than constantly locking and unlocking the mutex, adding 1 to the count and running |
96f75a8 to
3e0606b
Compare
RandomShaper
left a comment
There was a problem hiding this comment.
Leaving my approval on the added API. This needs to have the compatibility stuff fixed (which I'm not very familiar with) fixed per @AThousandShips comments before merging.
|
Was a named method considered ( |
e62d00d to
de4386b
Compare
de4386b to
33e5b4b
Compare
33e5b4b to
2656714
Compare
|
The co-author additions for just reviews aren't necessary by the way, feel free to remove them |
2656714 to
0b2f1e4
Compare
9f8db92 to
272bb73
Compare
Co-authored-by: RandomShaper <RandomShaper@users.noreply.github.com> Co-authored-by: A Thousand Ships (she/her) <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Mickeon <Mickeon@users.noreply.github.com>
272bb73 to
6311ee5
Compare
|
I think we can safely push this to 4.4 . Still waiting on the GDExtension and DotNet teams for review. |
|
Thanks! |
|
I've found something a bit concerning... One of my PRs was tested against 4.3, where it worked. On master it broke. The reason was that on master I had to add |
|
The |
|
It's been discussed (forget where) and I've looked at some tricks to make it easier by creating a custom callable from a But will see about opening some issue to track it and look at ideas when I can |
|
If this is a severe problem reverting this PR should be fine as it's a relatively small Quality-of-Life feature. |
Add optional count argument to `Semaphore::post`
Add optional count argument to `Semaphore::post`
Add optional count argument to `Semaphore::post`
Add optional count argument to `Semaphore::post`
Implements a new optional argument in Semaphore.post to allow resuming multiple threads at once.