Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: src/untrusted/pthread/pthread_internal.h

Issue 951583004: Implement pthread_rwlock functions for NaCl newlib (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/untrusted/pthread/pthread.gyp ('k') | src/untrusted/pthread/pthread_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/untrusted/pthread/pthread_internal.h
diff --git a/src/untrusted/pthread/pthread_internal.h b/src/untrusted/pthread/pthread_internal.h
index d15b86175c352de78c18808f0b06d2ff03559eed..eae8ce70bef8f2b33ff3ca6b872da18e3f110558 100644
--- a/src/untrusted/pthread/pthread_internal.h
+++ b/src/untrusted/pthread/pthread_internal.h
@@ -8,9 +8,12 @@
#define NATIVE_CLIENT_SRC_UNTRUSTED_PTHREAD_PTHREAD_INTERNAL_H_ 1
#include "native_client/src/untrusted/irt/irt.h"
+#include "native_client/src/untrusted/nacl/tls.h"
+#include "native_client/src/untrusted/nacl/tls_params.h"
#include "native_client/src/untrusted/pthread/pthread.h"
+#include "native_client/src/untrusted/pthread/pthread_types.h"
-struct nc_combined_tdb;
+#define TDB_SIZE (sizeof(struct nc_combined_tdb))
extern int __nc_thread_initialized;
extern pthread_t __nc_initial_thread_id;
@@ -23,4 +26,14 @@ void __nc_initialize_interfaces(void);
void __nc_tsd_exit(void);
+static inline struct nc_thread_descriptor *__nc_get_tdb(void) {
+ /*
+ * Fetch the thread-specific data pointer. This is usually just
+ * a wrapper around __libnacl_irt_tls.tls_get() but we don't use
+ * that here so that the IRT build can override the definition.
+ */
+ return (void *) ((char *) __nacl_read_tp_inline()
+ + __nacl_tp_tdb_offset(TDB_SIZE));
+}
+
#endif
« no previous file with comments | « src/untrusted/pthread/pthread.gyp ('k') | src/untrusted/pthread/pthread_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698