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

Side by Side Diff: native_client_sdk/src/libraries/sdk_util/ref_object.h

Issue 16325024: Move thread_pool.h into utils so it can be shared by more than one example. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 #ifndef LIBRARIES_UTILS_REF_OBJECT 6 #ifndef LIBRARIES_SDK_UTIL_REF_OBJECT
7 #define LIBRARIES_UTILS_REF_OBJECT 7 #define LIBRARIES_SDK_UTIL_REF_OBJECT
8 8
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include "pthread.h" 10 #include "pthread.h"
11 11
12 class RefObject { 12 class RefObject {
13 public: 13 public:
14 RefObject() { 14 RefObject() {
15 ref_count_ = 1; 15 ref_count_ = 1;
16 pthread_mutex_init(&lock_, NULL); 16 pthread_mutex_init(&lock_, NULL);
17 } 17 }
(...skipping 20 matching lines...) Expand all
38 38
39 // Override to clean up object when last reference is released. 39 // Override to clean up object when last reference is released.
40 virtual void Destroy() {} 40 virtual void Destroy() {}
41 41
42 pthread_mutex_t lock_; 42 pthread_mutex_t lock_;
43 43
44 private: 44 private:
45 int ref_count_; 45 int ref_count_;
46 }; 46 };
47 47
48 #endif // LIBRARIES_UTILS_REF_OBJECT 48 #endif // LIBRARIES_SDK_UTIL_REF_OBJECT
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698