IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2006, 2:42:35 PM (20 years ago)
Author:
eugene
Message:

moved check_permissions to libohana, added buttons to Kii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/addstar/src/DatasetOps.c

    r6498 r6674  
    11# include "addstar.h"
     2# include <pthread.h>
    23
    34/* the init function is an alternative */
     
    56pthread_mutex_t fastmutex = PTHREAD_MUTEX_INITIALIZER;
    67
    7 static int lock = FALSE;
    88static int Ndataset = 0;
    99static int NDATASET = 0;
     
    2929  int N;
    3030
    31   pthread_mutex_lock(&mutex);
     31  pthread_mutex_lock(&fastmutex);
    3232
    3333  N = Ndataset;
    3434  Ndataset ++;
    35   CHECK_REALLOCATE (dataset, DVO_DATA, NDATASET, Ndataset, 100);
     35  CHECK_REALLOCATE (dataset, DVO_DATA *, NDATASET, Ndataset, 100);
    3636
    3737  dataset[N] = data;
    3838
    39   pthread_mutex_unlock(&mutex);
     39  pthread_mutex_unlock(&fastmutex);
    4040  return (TRUE);
    4141}
     
    4444DVO_DATA *PopDataset (void) {
    4545
     46  int i;
    4647  DVO_DATA *data;
    4748
    48   pthread_mutex_lock(&mutex);
     49  pthread_mutex_lock(&fastmutex);
    4950
    5051  if (Ndataset == 0) {
    51     pthread_mutex_unlock(&mutex);
     52    pthread_mutex_unlock(&fastmutex);
    5253    return (NULL);
    5354  }
     
    6162  if ((Ndataset < NDATASET / 2) && (Ndataset > 50)) {
    6263    NDATASET = Ndataset / 2;
    63     REALLOCATE (dataset, DVO_DATA, NDATASET);
     64    REALLOCATE (dataset, DVO_DATA *, NDATASET);
    6465  }
    6566
    66   pthread_mutex_unlock(&mutex);
     67  pthread_mutex_unlock(&fastmutex);
    6768  return (data);
    6869}
Note: See TracChangeset for help on using the changeset viewer.