File tree Expand file tree Collapse file tree 15 files changed +11
-118
lines changed Expand file tree Collapse file tree 15 files changed +11
-118
lines changed Original file line number Diff line number Diff line change 4949using thread_id = ::thrd_t ;
5050
5151inline thread_id thread_get_current () { return ::thrd_current (); }
52- thread_id thread_get_main ();
5352bool thread_is_main ();
5453inline bool threads_same (thread_id a, thread_id b) {
5554 return ::thrd_equal (a, b);
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ using thread_id = ::pthread_t;
3232
3333inline thread_id thread_get_current () { return ::pthread_self (); }
3434
35- thread_id thread_get_main ();
36- bool thread_is_main ();
35+ inline bool thread_is_main () { return pthread_main_np (); }
3736
3837inline bool threads_same (thread_id a, thread_id b) {
3938 return ::pthread_equal (a, b);
Original file line number Diff line number Diff line change @@ -55,7 +55,6 @@ using thread_id = ::pthread_t;
5555
5656inline thread_id thread_get_current () { return ::pthread_self (); }
5757
58- thread_id thread_get_main ();
5958bool thread_is_main ();
6059
6160inline bool threads_same (thread_id a, thread_id b) {
Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ namespace threading_impl {
2525using thread_id = unsigned ;
2626
2727inline thread_id thread_get_current () { return 0 ; }
28- inline thread_id thread_get_main () { return 0 ; }
2928inline bool thread_is_main () { return true ; }
3029inline bool threads_same (thread_id a, thread_id b) { return a == b; }
3130
Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ using thread_id = ::pthread_t;
5454
5555inline thread_id thread_get_current () { return ::pthread_self (); }
5656
57- thread_id thread_get_main ();
5857bool thread_is_main ();
5958
6059inline bool threads_same (thread_id a, thread_id b) {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ namespace threading_impl {
2929using thread_id = ::DWORD;
3030
3131inline thread_id thread_get_current () { return ::GetCurrentThreadId (); }
32- thread_id thread_get_main ();
3332bool thread_is_main ();
3433inline bool threads_same (thread_id a, thread_id b) { return a == b; }
3534
Original file line number Diff line number Diff line change @@ -55,11 +55,6 @@ class Thread {
5555 return Thread (threading_impl::thread_get_current ());
5656 }
5757
58- // / Returns the main thread in this program
59- static Thread main () {
60- return Thread (threading_impl::thread_get_main ());
61- }
62-
6358 // / Returns true iff executed on the main thread
6459 static bool onMainThread () {
6560 return threading_impl::thread_is_main ();
Original file line number Diff line number Diff line change @@ -64,14 +64,9 @@ C11ThreadingHelper helper;
6464using namespace swift ;
6565using namespace threading_impl ;
6666
67- thread_id
68- swift::threading_impl::thread_get_main () {
69- return helper.main_thread ();
70- }
71-
7267bool
7368swift::threading_impl::thread_is_main () {
74- return thrd_equal (thrd_current (), thread_get_main ());
69+ return thrd_equal (thrd_current (), helper. main_thread ());
7570}
7671
7772void
Original file line number Diff line number Diff line change 1+ # If you update this, you also need to update the CMakeLists.txt file in
2+ # stdlib/public/Threading
3+
14add_swift_host_library(swiftThreading STATIC
25 C11.cpp
3- Darwin.cpp
46 Linux.cpp
5- Nothreads.cpp
67 Pthreads.cpp
78 Win32 .cpp)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments