cvsuser     03/12/13 04:57:03

  Modified:    config/gen/platform darwin.c darwin.h generic.h openbsd.h
               include/parrot thread.h
               src      tsq.c
  Log:
  cleanup borken COND_ macros; move darwins to header
  
  Revision  Changes    Path
  1.14      +1 -10     parrot/config/gen/platform/darwin.c
  
  Index: darwin.c
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/platform/darwin.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- darwin.c  1 Dec 2003 18:54:30 -0000       1.13
  +++ darwin.c  13 Dec 2003 12:56:32 -0000      1.14
  @@ -1,5 +1,5 @@
   /*
  -** platform.c [generic version]
  +** darwin.c
   */
   
   #include <time.h>
  @@ -9,15 +9,6 @@
   #undef bool
   #import <mach-o/dyld.h>
   
  -#include <pthread.h>
  -#define PARROT_SYNC_PRIMITIVES_DEFINED
  -#define LOCK(x) pthread_mutex_lock(x)
  -#define UNLOCK(x) pthread_mutex_unlock(x)
  -#define COND_WAIT(x,y) pthread_cond_wait(x, y)
  -#define COND_SIGNAL(x,y) pthread_cond_signal(x, y)
  -#define COND_BROADCAST(x,y) pthread_cond_broadcast(x, y)
  -typedef pthread_mutex_t Parrot_mutex;
  -typedef pthread_cond_t Parrot_cond;
   
   #include "parrot/parrot.h"
   
  
  
  
  1.5       +13 -0     parrot/config/gen/platform/darwin.h
  
  Index: darwin.h
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/platform/darwin.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -w -r1.4 -r1.5
  --- darwin.h  6 Jun 2003 08:29:44 -0000       1.4
  +++ darwin.h  13 Dec 2003 12:56:32 -0000      1.5
  @@ -2,6 +2,19 @@
   ** platform.h [darwin version]
   */
   
  +#ifdef PARROT_HAS_HEADER_PTHREAD
  +#  include <pthread.h>
  +#  define PARROT_SYNC_PRIMITIVES_DEFINED
  +#  define LOCK(m) pthread_mutex_lock(&m)
  +#  define UNLOCK(m) pthread_mutex_unlock(&m)
  +#  define COND_WAIT(c,m) pthread_cond_wait(&c, &m)
  +#  define COND_SIGNAL(c) pthread_cond_signal(&c)
  +#  define COND_BROADCAST(c) pthread_cond_broadcast(&c)
  +typedef pthread_mutex_t Parrot_mutex;
  +typedef pthread_cond_t Parrot_cond;
  +#endif
  +
  +
   
   /*
   ** I/O:
  
  
  
  1.11      +5 -5      parrot/config/gen/platform/generic.h
  
  Index: generic.h
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/platform/generic.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- generic.h 13 Aug 2003 05:59:15 -0000      1.10
  +++ generic.h 13 Dec 2003 12:56:32 -0000      1.11
  @@ -50,11 +50,11 @@
   #ifdef PARROT_HAS_HEADER_PTHREAD
   #  include <pthread.h>
   #  define PARROT_SYNC_PRIMITIVES_DEFINED
  -#  define LOCK(x) pthread_mutex_lock(&x)
  -#  define UNLOCK(x) pthread_mutex_unlock(&x)
  -#  define COND_WAIT(x,y) pthread_cond_wait(&x, &y)
  -#  define COND_SIGNAL(x,y) pthread_cond_signal(&x, &y)
  -#  define COND_BROADCAST(x,y) pthread_cond_broadcast(&x)
  +#  define LOCK(m) pthread_mutex_lock(&m)
  +#  define UNLOCK(m) pthread_mutex_unlock(&m)
  +#  define COND_WAIT(c,m) pthread_cond_wait(&c, &m)
  +#  define COND_SIGNAL(c) pthread_cond_signal(&c)
  +#  define COND_BROADCAST(c) pthread_cond_broadcast(&c)
      typedef pthread_mutex_t Parrot_mutex;
      typedef pthread_cond_t Parrot_cond;
   #endif
  
  
  
  1.2       +6 -6      parrot/config/gen/platform/openbsd.h
  
  Index: openbsd.h
  ===================================================================
  RCS file: /cvs/public/parrot/config/gen/platform/openbsd.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- openbsd.h 1 Dec 2003 22:16:37 -0000       1.1
  +++ openbsd.h 13 Dec 2003 12:56:32 -0000      1.2
  @@ -2,7 +2,7 @@
   #define PARROT_PLATFORM_H_GUARD
   
   /*
  -** platform.h [generic version]
  +** platform.h [openbsd version]
   */
   
   
  @@ -55,11 +55,11 @@
   #ifdef PARROT_HAS_HEADER_PTHREAD
   #  include <pthread.h>
   #  define PARROT_SYNC_PRIMITIVES_DEFINED
  -#  define LOCK(x) pthread_mutex_lock(&x)
  -#  define UNLOCK(x) pthread_mutex_unlock(&x)
  -#  define COND_WAIT(x,y) pthread_cond_wait(&x, &y)
  -#  define COND_SIGNAL(x,y) pthread_cond_signal(&x, &y)
  -#  define COND_BROADCAST(x,y) pthread_cond_broadcast(&x)
  +#  define LOCK(m) pthread_mutex_lock(&m)
  +#  define UNLOCK(m) pthread_mutex_unlock(&m)
  +#  define COND_WAIT(c,m) pthread_cond_wait(&c, &m)
  +#  define COND_SIGNAL(c) pthread_cond_signal(&c)
  +#  define COND_BROADCAST(c) pthread_cond_broadcast(&c)
      typedef pthread_mutex_t Parrot_mutex;
      typedef pthread_cond_t Parrot_cond;
   #endif
  
  
  
  1.6       +3 -3      parrot/include/parrot/thread.h
  
  Index: thread.h
  ===================================================================
  RCS file: /cvs/public/parrot/include/parrot/thread.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -r1.5 -r1.6
  --- thread.h  21 Jul 2003 18:00:42 -0000      1.5
  +++ thread.h  13 Dec 2003 12:56:56 -0000      1.6
  @@ -1,7 +1,7 @@
   /* thread.h
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: thread.h,v 1.5 2003/07/21 18:00:42 chromatic Exp $
  + *     $Id: thread.h,v 1.6 2003/12/13 12:56:56 leo Exp $
    *  Overview:
    *     This is the api header for the thread primitives
    *  Data Structure and Algorithms:
  @@ -19,8 +19,8 @@
   #define LOCK(x)
   #define UNLOCK(x)
   #define COND_WAIT(x, y)
  -#define COND_SIGNAL(x, y)
  -#define COND_BROADCAST(x, y)
  +#define COND_SIGNAL(x)
  +#define COND_BROADCAST(x)
   
   #define Parrot_mutex INTVAL
   #define Parrot_cond INTVAL
  
  
  
  1.7       +2 -2      parrot/src/tsq.c
  
  Index: tsq.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/tsq.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -r1.6 -r1.7
  --- tsq.c     23 Oct 2003 17:48:59 -0000      1.6
  +++ tsq.c     13 Dec 2003 12:57:02 -0000      1.7
  @@ -1,7 +1,7 @@
   /* tsq.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: tsq.c,v 1.6 2003/10/23 17:48:59 robert Exp $
  + *     $Id: tsq.c,v 1.7 2003/12/13 12:57:02 leo Exp $
    *  Overview:
    *     Thread-safe queues
    *  Data Structure and Algorithms:
  @@ -85,7 +85,7 @@
   /* This function wakes up *every* thread waiting on the queue */
   void
   queue_signal(QUEUE *queue) {
  -    COND_BROADCAST(queue->queue_condition, queue->queue_mutex);
  +    COND_BROADCAST(queue->queue_condition);
   }
   
   void
  
  
  

Reply via email to