com php-src: export the main thread info: TSRM/TSRM.c TSRM/TSRM.h

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    4d64a49fcd0218f2656e964d25d4e02d844c1e03
Author:    Anatol Belski <[email protected]>         Sat, 15 Apr 2017 14:28:58 +0200
Parents:   6a2b48b4e57ccb7ecb65d2f333097bec414375b7
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=4d64a49fcd0218f2656e964d25d4e02d844c1e03

Log:
export the main thread info

Changed paths:
  M  TSRM/TSRM.c
  M  TSRM/TSRM.h


Diff:
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index 2c7a40a..4c635a0 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -814,4 +814,9 @@ TSRM_API void *tsrm_get_ls_cache(void)
 	return tsrm_tls_get();
 }
 
+TSRM_API uint8_t tsrm_is_main_thread(void)
+{
+	return in_main_thread;
+}
+
 #endif /* ZTS */
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index 2ffcbfe..3a06ccd 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -155,6 +155,7 @@ TSRM_API void *tsrm_set_interpreter_context(void *new_ctx);
 TSRM_API void tsrm_free_interpreter_context(void *context);
 
 TSRM_API void *tsrm_get_ls_cache(void);
+TSRM_API uint8_t tsrm_is_main_thread(void);
 
 #ifdef TSRM_WIN32
 # define TSRM_TLS __declspec(thread)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.