diff options
| author | Philipp Stephani | 2018-01-17 23:28:46 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2018-01-18 20:14:36 +0100 |
| commit | 694ee38f8b7bd10f1d0eae8cb251daea70b5c820 (patch) | |
| tree | 53a4ebc808225e3c87bc8db48092e7f7ec8b7d92 /src/thread.c | |
| parent | ebc1eea87b1309544ccb1a8a3ce53698cc2355d6 (diff) | |
| download | emacs-694ee38f8b7bd10f1d0eae8cb251daea70b5c820.tar.gz emacs-694ee38f8b7bd10f1d0eae8cb251daea70b5c820.zip | |
Fix module support if threads are disabled (Bug#30106)
* src/systhread.c (sys_thread_equal): New function.
* src/thread.c (in_current_thread): Move from emacs-module.c; use
sys_thread_equal.
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c index 60902b252b4..f11e3e5addb 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -1022,6 +1022,14 @@ main_thread_p (void *ptr) | |||
| 1022 | return ptr == &main_thread; | 1022 | return ptr == &main_thread; |
| 1023 | } | 1023 | } |
| 1024 | 1024 | ||
| 1025 | bool | ||
| 1026 | in_current_thread (void) | ||
| 1027 | { | ||
| 1028 | if (current_thread == NULL) | ||
| 1029 | return false; | ||
| 1030 | return sys_thread_equal (sys_thread_self (), current_thread->thread_id); | ||
| 1031 | } | ||
| 1032 | |||
| 1025 | void | 1033 | void |
| 1026 | init_threads_once (void) | 1034 | init_threads_once (void) |
| 1027 | { | 1035 | { |