Repository navigation
Concurrency refactors and cleanups - #13352
Conversation
|
I'm confused by this PR.
My understanding is that |
|
Notes on the other commits (skimmed quickly):
|
|
Thanks a lot for the review!
I think the typedef would have been useful if the C compiler could somehow check conversions between the type alias and the type behind the typedef, a bit like private types in OCaml. It would also have been useful if we were declaring a custom error type. The
In
Thanks for the explanation, I'll hold this commit for a while. It's not too bad to merge
IMO this is unnecessary code (early returns matter, but these?), |
951b5ca to
91c49c9
Compare
91c49c9 to
63d8d4a
Compare
|
You removed the commits I was grumpy about (thanks!). I had a new look and they are overall fine, but I don't know about the last one ("extract common code that is not posix/pthreads"). I find the current (trunk) structure a bit complex already (st_pthreads.h is a "mixin" that both provides features and expects requirements from its includer), and the new layering you propose is even slightly more complex. Two questions about this:
|
Done.
It's also just possible to add prototypes for |
I find this a bit complex. Maybe we should do the work of writing down the interface of both files, what they expect from the other file and what they provide? If this is more work than you want to tackle, personally I would err on the side of keeping things in st_pthreads.h for now, we don't need to decouple everything in one go. |
I'll give it a go.
I'm working on replacing winpthreads with Windows primitives. My idea was to extract functions that are not using pthreads/unix signals from |
63d8d4a to
3398266
Compare
It checks itself the value of err.
Its definition is already guarded by the DEBUG macro.
45a7051 to
ede6ab8
Compare
|
Thanks for the reviews! I've moved the declaration of the functions in |
ede6ab8 to
7e77e33
Compare
Have you considered the suggestion I made earlier? It was as follows:
|
7e77e33 to
98179e3
Compare
Indeed, I forgot this. It's really nice now, thanks! |
Remove the dependency of st_bt_lock_acquire() and st_bt_lock_release() on st_masterlock.
98179e3 to
806f3df
Compare
|
I believe I've addressed all the comments. |
|
You forgot to update the Changes entry to credit @dustanddreams' bug-catching review. |
806f3df to
62271ec
Compare
|
Merged, thanks! |
While working on replacing winpthreads (the pthreads emulation layer on Windows) with direct use of the WinAPI concurrency primitives, I've gathered a few refactors and cleanups on systhreads and the runtime.
The end goal is to share common code between platforms using pthreads and Windows, and have platform specific code in different files. As it doesn't make much sense to have
st_pthreads.handst_posix.hI'm removingst_pthreads.hand inlining relevant code in eitherst_posix.horst_win32.h, and introducing a newst_stubs.hfor common code.I'm opening this PR now because it mildly conflicts with #12410 and #13348, and I don't enjoy dealing with conflicts too much (but yay for
git rerere), so better now than later? (of course if they get merged first, I'll rebase this PR).