Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e862350b authored by Yabin Cui's avatar Yabin Cui Committed by Gerrit Code Review
Browse files

Merge "Kill HAVE_PTHREADS."

parents c6091d6b 4a6e5a3b
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ extern "C" {
/***********************************************************************/
/***********************************************************************/

#ifdef HAVE_PTHREADS
#if !defined(_WIN32)

#include  <pthread.h>

@@ -42,7 +42,7 @@ typedef struct {

#define  THREAD_STORE_INITIALIZER  { PTHREAD_MUTEX_INITIALIZER, 0, 0 }

#elif defined HAVE_WIN32_THREADS
#else // !defined(_WIN32)

#include <windows.h>

@@ -56,9 +56,7 @@ typedef struct {

#define  THREAD_STORE_INITIALIZER  { 0, 0, 0, {0, 0, 0, 0, 0, 0} }

#else
#  error  "no thread_store_t implementation for your platform !!"
#endif
#endif // !defined(_WIN32)

typedef void  (*thread_store_destruct_t)(void*  value);

@@ -76,7 +74,7 @@ extern void thread_store_set(thread_store_t* store,
/***********************************************************************/
/***********************************************************************/

#ifdef HAVE_PTHREADS
#if !defined(_WIN32)

typedef pthread_mutex_t   mutex_t;

@@ -98,9 +96,9 @@ static __inline__ void mutex_destroy(mutex_t* lock)
{
    pthread_mutex_destroy(lock);
}
#endif

#ifdef HAVE_WIN32_THREADS
#else // !defined(_WIN32)

typedef struct {
    int                init;
    CRITICAL_SECTION   lock[1];
@@ -137,7 +135,7 @@ static __inline__ void mutex_destroy(mutex_t* lock)
        DeleteCriticalSection(lock->lock);
    }
}
#endif
#endif // !defined(_WIN32)

#ifdef __cplusplus
}
+2 −4
Original line number Diff line number Diff line
@@ -28,14 +28,12 @@
#ifndef _LIBS_LOG_LOG_H
#define _LIBS_LOG_LOG_H

#include <sys/types.h>
#ifdef HAVE_PTHREADS
#include <pthread.h>
#endif
#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>

#include <log/logd.h>
#include <log/uio.h>

+8 −7
Original line number Diff line number Diff line
@@ -23,16 +23,17 @@
#include <android/log.h>

/* the rest is only used internally by the system */
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <sys/types.h>
#ifdef HAVE_PTHREADS
#if !defined(_WIN32)
#include <pthread.h>
#endif
#include <log/uio.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>

#include <log/uio.h>

#ifdef __cplusplus
extern "C" {
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
#include <stdint.h>
#include <sys/types.h>

#if defined(HAVE_PTHREADS)
#if !defined(_WIN32)
# include <pthread.h>
#endif

+4 −4
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <sys/types.h>
#include <time.h>

#if defined(HAVE_PTHREADS)
#if !defined(_WIN32)
# include <pthread.h>
#endif

@@ -74,7 +74,7 @@ public:
    void broadcast();

private:
#if defined(HAVE_PTHREADS)
#if !defined(_WIN32)
    pthread_cond_t mCond;
#else
    void*   mState;
@@ -83,7 +83,7 @@ private:

// ---------------------------------------------------------------------------

#if defined(HAVE_PTHREADS)
#if !defined(_WIN32)

inline Condition::Condition() {
    pthread_cond_init(&mCond, NULL);
@@ -149,7 +149,7 @@ inline void Condition::broadcast() {
    pthread_cond_broadcast(&mCond);
}

#endif // HAVE_PTHREADS
#endif // !defined(_WIN32)

// ---------------------------------------------------------------------------
}; // namespace android
Loading