Rename HB_UNICODE_GENERAL_CATEGORY_COMBINING_MARK to HB_UNICODE_GENERAL_CATEGORY_SPAC...
[profile/ivi/org.tizen.video-player.git] / src / hb-mutex-private.hh
index be0f687..91c9438 100644 (file)
@@ -69,12 +69,12 @@ typedef CRITICAL_SECTION hb_mutex_impl_t;
 
 #warning "Could not find any system to define platform macros, library will NOT be thread-safe"
 
-typedef struct { volatile int m; } hb_mutex_impl_t;
+typedef volatile int hb_mutex_impl_t;
 #define HB_MUTEX_IMPL_INIT     0
-#define hb_mutex_impl_init(M)  ((void) ((M)->m = 0))
-#define hb_mutex_impl_lock(M)  ((void) ((M)->m = 1))
-#define hb_mutex_impl_unlock(M)        ((void) ((M)->m = 0))
-#define hb_mutex_impl_free(M)  ((void) ((M)-M = 2))
+#define hb_mutex_impl_init(M)  ((void) (*(M) = 0))
+#define hb_mutex_impl_lock(M)  ((void) (*(M) = 1))
+#define hb_mutex_impl_unlock(M)        ((void) (*(M) = 0))
+#define hb_mutex_impl_free(M)  ((void) (*(M) = 2))
 
 
 #endif
@@ -100,6 +100,7 @@ struct hb_mutex_t
 struct hb_static_mutex_t : hb_mutex_t
 {
   hb_static_mutex_t (void)  { this->init (); }
+  ~hb_static_mutex_t (void) { this->free (); }
 
   private:
   NO_COPY (hb_static_mutex_t);
@@ -108,46 +109,4 @@ struct hb_static_mutex_t : hb_mutex_t
 
 HB_END_DECLS
 
-
-template <typename item_t>
-struct hb_static_threadsafe_set_t
-{
-  hb_lockable_set_t <item_t, hb_static_mutex_t> set;
-  hb_static_mutex_t lock;
-
-  template <typename T>
-  inline item_t *replace_or_insert (T v)
-  {
-    return set.replace_or_insert (v, lock);
-  }
-
-  template <typename T>
-  inline void remove (T v)
-  {
-    set.remove (v, lock);
-  }
-
-  template <typename T>
-  inline bool find (T v, item_t *i)
-  {
-    return set.find (v, i, lock);
-  }
-
-  template <typename T>
-  inline item_t *find_or_insert (T v)
-  {
-    return set.find_or_insert (v, lock);
-  }
-
-  void finish (void)
-  {
-    set.finish (lock);
-  }
-};
-
-
-HB_BEGIN_DECLS
-
-HB_END_DECLS
-
 #endif /* HB_MUTEX_PRIVATE_HH */