IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5174 for trunk/psLib/src/types


Ignore:
Timestamp:
Sep 28, 2005, 3:15:38 PM (21 years ago)
Author:
drobbin
Message:

Added fxns psImageRow/Col and tests. Updated psList struct to add void *lock.

Location:
trunk/psLib/src/types
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psList.c

    r4898 r5174  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-08-30 01:14:13 $
     8 *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-09-29 01:15:38 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3939    }
    4040
    41     pthread_mutex_lock(&list->lock)
    42     ;
     41    pthread_mutex_lock(&list->p_lock);
    4342
    4443    // remove the free function of iterators to avoid double removal from list
     
    5958    }
    6059
    61     pthread_mutex_unlock(&list->lock)
    62     ;
    63 
    64     pthread_mutex_destroy(&list->lock)
    65     ;
     60    pthread_mutex_unlock(&list->p_lock);
     61
     62    pthread_mutex_destroy(&list->p_lock);
    6663
    6764}
     
    8885    int index = iterator->index;
    8986
    90     pthread_mutex_lock(&list->lock)
    91     ;
     87    pthread_mutex_lock(&list->p_lock);
    9288
    9389    if (elem == list->head) {        // head of list?
     
    115111    list->n--;
    116112
    117     pthread_mutex_unlock(&list->lock)
     113    pthread_mutex_unlock(&list->p_lock)
    118114    ;
    119115
     
    139135    psListIteratorAlloc(list,PS_LIST_HEAD,true);
    140136
    141     pthread_mutex_init(&(list->lock), NULL)
    142     ;
     137    pthread_mutex_init(&(list->p_lock), NULL);
    143138
    144139    if (data != NULL) {
     
    322317    psListElem* elem = psAlloc(sizeof(psListElem));
    323318
    324     pthread_mutex_lock(&list->lock)
    325     ;
     319    pthread_mutex_lock(&list->p_lock);
    326320
    327321    // set the new list element's attributes
     
    359353    }
    360354
    361     pthread_mutex_unlock(&list->lock)
    362     ;
     355    pthread_mutex_unlock(&list->p_lock);
    363356
    364357    return true;
     
    397390    psListElem* elem = psAlloc(sizeof(psListElem));
    398391
    399     pthread_mutex_lock(&list->lock)
    400     ;
     392    pthread_mutex_lock(&list->p_lock);
    401393
    402394    // set the new list element's attributes
     
    434426    }
    435427
    436     pthread_mutex_unlock(&list->lock)
    437     ;
     428    pthread_mutex_unlock(&list->p_lock);
    438429
    439430    return true;
  • trunk/psLib/src/types/psList.h

    r4898 r5174  
    77 *  @ingroup LinkedList
    88 *
    9  *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-08-30 01:14:13 $
     9 *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-09-29 01:15:38 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6060    ///< others are user-level iterators created by psListIteratorAlloc.
    6161
    62     pthread_mutex_t lock;              ///< mutex to lock a node during changes
    63 //    void *lock;                        ///< Optional lock for thread safety
     62    pthread_mutex_t p_lock;            ///< mutex to lock a node during changes
     63    void *lock;                        ///< Optional lock for thread safety
    6464}
    6565psList;
     
    7575typedef struct
    7676{
    77 psList* list;                      ///< List iterator to works on
    78 psListElem* cursor;                ///< current cursor position
    79 bool offEnd;                       ///< Iterator off the end?
    80 long index;                         ///< the index number in the list
    81 bool mutable;                      ///< Is it permissible to modify the list?
     77    psList* list;                      ///< List iterator to works on
     78    psListElem* cursor;                ///< current cursor position
     79    bool offEnd;                       ///< Iterator off the end?
     80    long index;                         ///< the index number in the list
     81    bool mutable;                      ///< Is it permissible to modify the list?
    8282}
    8383psListIterator;
  • trunk/psLib/src/types/psMetadata.h

    r5136 r5174  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-09-26 21:13:26 $
     13*  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2005-09-29 01:15:38 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    136136;
    137137
    138 
    139138/** Checks the type of a particular pointer.
    140139 *
  • trunk/psLib/src/types/psMetadataConfig.c

    r5136 r5174  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-09-26 21:13:26 $
     12*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-09-29 01:15:38 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5757/** Maximum size of a string */
    5858#define MAX_STRING_LENGTH 256
    59 #define MAXSTR 256
     59#define MAXSTR 2256
    6060
    6161
     
    12281228    psString newString = NULL;
    12291229    psString newStr = NULL;
    1230     char mdString[2048];
     1230    char mdString[16000];
    12311231    psMetadataItem *item = NULL;
    12321232    psMetadataIterator *iter = psMetadataIteratorAlloc(md, PS_LIST_HEAD, NULL);
     
    12421242    while ( (item = psMetadataGetAndIncrement(iter)) ) {
    12431243        type = item->type;
    1244         if ( type == PS_DATA_STRING)
     1244        if ( type == PS_DATA_STRING) {
    12451245            type = PS_DATA_STRING;
    1246         if ( type == PS_DATA_VECTOR)
     1246        }
     1247        if ( type == PS_DATA_VECTOR) {
    12471248            type = PS_DATA_VECTOR;
    1248         if ( type == PS_DATA_TIME)
     1249        }
     1250        if ( type == PS_DATA_TIME) {
    12491251            type = PS_DATA_TIME;
    1250         if ( item->type == PS_DATA_METADATA)
     1252        }
     1253        if ( item->type == PS_DATA_METADATA) {
    12511254            type = PS_DATA_METADATA;
     1255        }
     1256        if (item == NULL) {
     1257            type = PS_DATA_UNKNOWN;
     1258        }
    12521259
    12531260        switch (type) {
     
    14551462        }
    14561463    }
    1457     newString = psStringNCopy(mdString, 2048);
     1464    newString = psStringNCopy(mdString, 16000);
    14581465    psFree(iter);
    14591466    return newString;
Note: See TracChangeset for help on using the changeset viewer.