Don't mark GThread struct as deprecated
[platform/upstream/glib.git] / glib / deprecated / gthread.h
index 7a5c327..4c7b304 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
  * GLib at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
-#error "Only <glib.h> can be included directly."
-#endif
-
 #ifndef __G_DEPRECATED_THREAD_H__
 #define __G_DEPRECATED_THREAD_H__
 
+#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
 #include <glib/gthread.h>
 
 G_BEGIN_DECLS
 
+#ifndef G_DISABLE_DEPRECATED
+
 typedef enum
 {
   G_THREAD_PRIORITY_LOW,
@@ -43,6 +43,8 @@ typedef enum
   G_THREAD_PRIORITY_URGENT
 } GThreadPriority;
 
+#endif
+
 struct  _GThread
 {
   /*< private >*/
@@ -52,6 +54,8 @@ struct  _GThread
   GThreadPriority priority;
 };
 
+#ifndef G_DISABLE_DEPRECATED
+
 typedef struct _GThreadFunctions GThreadFunctions;
 struct _GThreadFunctions
 {
@@ -96,13 +100,13 @@ GLIB_VAR gboolean               g_thread_use_default_impl;
 
 GLIB_VAR guint64   (*g_thread_gettime) (void);
 
-GLIB_DEPRECATED_FOR(g_thread_new)
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
 GThread *g_thread_create       (GThreadFunc       func,
                                 gpointer          data,
                                 gboolean          joinable,
                                 GError          **error);
 
-GLIB_DEPRECATED_FOR(g_thread_new)
+GLIB_DEPRECATED_IN_2_32_FOR(g_thread_new)
 GThread *g_thread_create_full  (GThreadFunc       func,
                                 gpointer          data,
                                 gulong            stack_size,
@@ -111,15 +115,16 @@ GThread *g_thread_create_full  (GThreadFunc       func,
                                 GThreadPriority   priority,
                                 GError          **error);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void     g_thread_set_priority (GThread          *thread,
                                 GThreadPriority   priority);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void     g_thread_foreach      (GFunc             thread_func,
                                 gpointer          user_data);
 
 #ifndef G_OS_WIN32
+#include <sys/types.h>
 #include <pthread.h>
 #endif
 
@@ -141,10 +146,11 @@ typedef struct
 #define g_static_mutex_unlock(mutex) \
     g_mutex_unlock (g_static_mutex_get_mutex (mutex))
 
-GLIB_DEPRECATED_FOR(g_mutex_init)
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_init)
 void    g_static_mutex_init           (GStaticMutex *mutex);
-GLIB_DEPRECATED_FOR(g_mutex_free)
+GLIB_DEPRECATED_IN_2_32_FOR(g_mutex_clear)
 void    g_static_mutex_free           (GStaticMutex *mutex);
+GLIB_DEPRECATED_IN_2_32_FOR(GMutex)
 GMutex *g_static_mutex_get_mutex_impl (GStaticMutex *mutex);
 
 typedef struct _GStaticRecMutex GStaticRecMutex;
@@ -162,30 +168,30 @@ struct _GStaticRecMutex
     pthread_t owner;
 #endif
     gdouble dummy;
-  };
+  } unused;
 };
 
 #define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT }
-GLIB_DEPRECATED_FOR(g_rec_mutex_init)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_init)
 void     g_static_rec_mutex_init        (GStaticRecMutex *mutex);
 
-GLIB_DEPRECATED_FOR(g_rec_mutex_lock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_lock)
 void     g_static_rec_mutex_lock        (GStaticRecMutex *mutex);
 
-GLIB_DEPRECATED_FOR(g_rec_mutex_try_lock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_try_lock)
 gboolean g_static_rec_mutex_trylock     (GStaticRecMutex *mutex);
 
-GLIB_DEPRECATED_FOR(g_rec_mutex_unlock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_unlock)
 void     g_static_rec_mutex_unlock      (GStaticRecMutex *mutex);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void     g_static_rec_mutex_lock_full   (GStaticRecMutex *mutex,
                                          guint            depth);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 guint    g_static_rec_mutex_unlock_full (GStaticRecMutex *mutex);
 
-GLIB_DEPRECATED_FOR(g_rec_mutex_free)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rec_mutex_free)
 void     g_static_rec_mutex_free        (GStaticRecMutex *mutex);
 
 typedef struct _GStaticRWLock GStaticRWLock;
@@ -203,31 +209,31 @@ struct _GStaticRWLock
 
 #define G_STATIC_RW_LOCK_INIT { G_STATIC_MUTEX_INIT, NULL, NULL, 0, FALSE, 0, 0 }
 
-GLIB_DEPRECATED_FOR(g_rw_lock_init)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_init)
 void      g_static_rw_lock_init           (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_reader_lock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_lock)
 void      g_static_rw_lock_reader_lock    (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_reader_trylock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_trylock)
 gboolean  g_static_rw_lock_reader_trylock (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_reader_unlock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_reader_unlock)
 void      g_static_rw_lock_reader_unlock  (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_writer_lock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_lock)
 void      g_static_rw_lock_writer_lock    (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_writer_trylock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_trylock)
 gboolean  g_static_rw_lock_writer_trylock (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_writer_unlock)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_writer_unlock)
 void      g_static_rw_lock_writer_unlock  (GStaticRWLock *lock);
 
-GLIB_DEPRECATED_FOR(g_rw_lock_free)
+GLIB_DEPRECATED_IN_2_32_FOR(g_rw_lock_free)
 void      g_static_rw_lock_free           (GStaticRWLock *lock);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 GPrivate *      g_private_new             (GDestroyNotify notify);
 
 typedef struct _GStaticPrivate  GStaticPrivate;
@@ -238,50 +244,50 @@ struct _GStaticPrivate
 };
 
 #define G_STATIC_PRIVATE_INIT { 0 }
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void     g_static_private_init           (GStaticPrivate *private_key);
 
-GLIB_DEPRECATED_FOR(g_private_get)
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_get)
 gpointer g_static_private_get            (GStaticPrivate *private_key);
 
-GLIB_DEPRECATED_FOR(g_private_set)
+GLIB_DEPRECATED_IN_2_32_FOR(g_private_set)
 void     g_static_private_set            (GStaticPrivate *private_key,
                                           gpointer        data,
                                           GDestroyNotify  notify);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void     g_static_private_free           (GStaticPrivate *private_key);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 gboolean g_once_init_enter_impl          (volatile gsize *location);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void     g_thread_init                   (gpointer vtable);
+GLIB_DEPRECATED_IN_2_32
+void    g_thread_init_with_errorcheck_mutexes (gpointer vtable);
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 gboolean g_thread_get_initialized        (void);
 
 GLIB_VAR gboolean g_threads_got_initialized;
 
-#if defined(G_THREADS_MANDATORY)
-#define g_thread_supported()     1
-#else
-#define g_thread_supported()    (g_threads_got_initialized)
-#endif
+#define g_thread_supported()     (1)
 
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 GMutex *        g_mutex_new             (void);
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void            g_mutex_free            (GMutex *mutex);
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 GCond *         g_cond_new              (void);
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 void            g_cond_free             (GCond  *cond);
-GLIB_DEPRECATED
+GLIB_DEPRECATED_IN_2_32
 gboolean        g_cond_timed_wait       (GCond          *cond,
                                          GMutex         *mutex,
                                          GTimeVal       *timeval);
 
+#endif
+
 G_END_DECLS
 
 #endif /* __G_DEPRECATED_THREAD_H__ */