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 12
12
13
13
#include < new>
14
14
15
+ #include " swift/Runtime/Config.h"
15
16
#include " swift/Threading/Mutex.h"
16
17
17
18
namespace swift {
18
19
// return the size in words for the given mutex primitive
20
+ SWIFT_CC (swift)
19
21
extern " C"
20
22
size_t _swift_async_stream_lock_size () {
21
23
size_t words = sizeof (Mutex) / sizeof (void *);
22
24
if (words < 1 ) { return 1 ; }
23
25
return words;
24
26
}
25
27
28
+ SWIFT_CC (swift)
26
29
extern " C" void _swift_async_stream_lock_init (Mutex &lock) {
27
30
new (&lock) Mutex ();
28
31
}
29
32
33
+ SWIFT_CC (swift)
30
34
extern " C" void _swift_async_stream_lock_lock (Mutex &lock) { lock.lock (); }
31
35
36
+ SWIFT_CC (swift)
32
37
extern " C" void _swift_async_stream_lock_unlock (Mutex &lock) { lock.unlock (); }
33
38
}
Original file line number Diff line number Diff line change 12
12
13
13
#include < new>
14
14
15
+ #include " swift/Runtime/Config.h"
15
16
#include " swift/Threading/Mutex.h"
16
17
17
18
namespace swift {
18
19
// return the size in words for the given mutex primitive
20
+ SWIFT_CC (swift)
19
21
extern " C"
20
22
size_t _swift_async_stream_lock_size () {
21
23
size_t words = sizeof (Mutex) / sizeof (void *);
22
24
if (words < 1 ) { return 1 ; }
23
25
return words;
24
26
}
25
27
28
+ SWIFT_CC (swift)
26
29
extern " C" void _swift_async_stream_lock_init (Mutex &lock) {
27
30
new (&lock) Mutex ();
28
31
}
29
32
33
+ SWIFT_CC (swift)
30
34
extern " C" void _swift_async_stream_lock_lock (Mutex &lock) { lock.lock (); }
31
35
36
+ SWIFT_CC (swift)
32
37
extern " C" void _swift_async_stream_lock_unlock (Mutex &lock) { lock.unlock (); }
33
38
}
You can’t perform that action at this time.
0 commit comments