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

Unified Diff: webkit/build/JavaScriptCore/pthread.h

Issue 402054: Revert "Delete a bunch of deprecated and/or empty directores in src/webkit/." (Closed)
Patch Set: Created 11 years, 1 month 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 | « webkit/build/JavaScriptCore/prebuild.bat ('k') | webkit/build/JavaScriptCore/sched.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/build/JavaScriptCore/pthread.h
diff --git a/webkit/build/JavaScriptCore/pthread.h b/webkit/build/JavaScriptCore/pthread.h
new file mode 100644
index 0000000000000000000000000000000000000000..3259fe8bbbb239a1b4efd716eae8f362db8b6f16
--- /dev/null
+++ b/webkit/build/JavaScriptCore/pthread.h
@@ -0,0 +1,94 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_WEBKIT_BUILD_JAVASCRIPTCORE_PTHREAD_H__
+#define CHROME_WEBKIT_BUILD_JAVASCRIPTCORE_PTHREAD_H__
+
+#include <errno.h>
+#include "wtf/Assertions.h"
+
+// Dummy implementations of various pthread APIs
+
+// ----------------------------------------------------------------------------
+// pthread_t
+
+typedef int pthread_t;
+
+inline pthread_t pthread_self() {
+ return 0;
+}
+inline int pthread_equal(pthread_t a, pthread_t b) {
+ return a == b;
+}
+inline int pthread_create(pthread_t* thread, void*, void* (*)(void*), void*) {
+ ASSERT_NOT_REACHED();
+ return EINVAL;
+}
+inline int pthread_join(pthread_t thread, void **) {
+ ASSERT_NOT_REACHED();
+ return EINVAL;
+}
+
+// ----------------------------------------------------------------------------
+// pthread_mutex_t
+
+typedef int pthread_mutex_t;
+
+inline int pthread_mutex_init(pthread_mutex_t* mutex, const void*) {
+ return 0;
+}
+inline int pthread_mutex_destroy(pthread_mutex_t* mutex) {
+ return 0;
+}
+inline int pthread_mutex_lock(pthread_mutex_t* mutex) {
+ return 0;
+}
+
+inline int pthread_mutex_trylock(pthread_mutex_t* mutex) {
+ return 0;
+}
+
+inline int pthread_mutex_unlock(pthread_mutex_t* mutex) {
+ return 0;
+}
+
+#define PTHREAD_MUTEX_INITIALIZER 0
+
+//
+// pthread_cond_t
+typedef int pthread_cond_t;
+
+inline int pthread_cond_init(pthread_cond_t* cond, const void*) {
+ return 0;
+}
+inline int pthread_cond_destroy(pthread_cond_t* cond) {
+ return 0;
+}
+
+inline int pthread_cond_wait(pthread_cond_t *, pthread_mutex_t *) {
+ return 0;
+}
+inline int pthread_cond_signal(pthread_cond_t *) {
+ return 0;
+}
+inline int pthread_cond_broadcast(pthread_cond_t *) {
+ return 0;
+}
+
+// ----------------------------------------------------------------------------
+// pthread_key_t
+
+typedef int pthread_key_t;
+
+void pthread_setspecific(pthread_key_t key, void* value) {
+ TlsSetValue(key, value);
+}
+
+void pthread_key_create(pthread_key_t* key, void* destructor) {
+ // TODO(mbelshe): hook up the per-thread destructor.
+ *key = TlsAlloc();
+}
+
+
+#endif // CHROME_WEBKIT_BUILD_JAVASCRIPTCORE_PTHREAD_H__
« no previous file with comments | « webkit/build/JavaScriptCore/prebuild.bat ('k') | webkit/build/JavaScriptCore/sched.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698