File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1212
1313#include < new>
1414
15+ #include " swift/Runtime/Config.h"
1516#include " swift/Threading/Mutex.h"
1617
1718namespace swift {
1819// return the size in words for the given mutex primitive
20+ SWIFT_CC (swift)
1921extern " C"
2022size_t _swift_async_stream_lock_size () {
2123 size_t words = sizeof (Mutex) / sizeof (void *);
2224 if (words < 1 ) { return 1 ; }
2325 return words;
2426}
2527
28+ SWIFT_CC (swift)
2629extern " C" void _swift_async_stream_lock_init (Mutex &lock) {
2730 new (&lock) Mutex ();
2831}
2932
33+ SWIFT_CC (swift)
3034extern " C" void _swift_async_stream_lock_lock (Mutex &lock) { lock.lock (); }
3135
36+ SWIFT_CC (swift)
3237extern " C" void _swift_async_stream_lock_unlock (Mutex &lock) { lock.unlock (); }
3338}
Original file line number Diff line number Diff line change 1212
1313#include < new>
1414
15+ #include " swift/Runtime/Config.h"
1516#include " swift/Threading/Mutex.h"
1617
1718namespace swift {
1819// return the size in words for the given mutex primitive
20+ SWIFT_CC (swift)
1921extern " C"
2022size_t _swift_async_stream_lock_size () {
2123 size_t words = sizeof (Mutex) / sizeof (void *);
2224 if (words < 1 ) { return 1 ; }
2325 return words;
2426}
2527
28+ SWIFT_CC (swift)
2629extern " C" void _swift_async_stream_lock_init (Mutex &lock) {
2730 new (&lock) Mutex ();
2831}
2932
33+ SWIFT_CC (swift)
3034extern " C" void _swift_async_stream_lock_lock (Mutex &lock) { lock.lock (); }
3135
36+ SWIFT_CC (swift)
3237extern " C" void _swift_async_stream_lock_unlock (Mutex &lock) { lock.unlock (); }
3338}
You can’t perform that action at this time.
0 commit comments