Changeset 5174 for trunk/psLib/src/types
- Timestamp:
- Sep 28, 2005, 3:15:38 PM (21 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 4 edited
-
psList.c (modified) (10 diffs)
-
psList.h (modified) (3 diffs)
-
psMetadata.h (modified) (2 diffs)
-
psMetadataConfig.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psList.c
r4898 r5174 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 8-30 01:14:13$8 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-09-29 01:15:38 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 } 40 40 41 pthread_mutex_lock(&list->lock) 42 ; 41 pthread_mutex_lock(&list->p_lock); 43 42 44 43 // remove the free function of iterators to avoid double removal from list … … 59 58 } 60 59 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); 66 63 67 64 } … … 88 85 int index = iterator->index; 89 86 90 pthread_mutex_lock(&list->lock) 91 ; 87 pthread_mutex_lock(&list->p_lock); 92 88 93 89 if (elem == list->head) { // head of list? … … 115 111 list->n--; 116 112 117 pthread_mutex_unlock(&list-> lock)113 pthread_mutex_unlock(&list->p_lock) 118 114 ; 119 115 … … 139 135 psListIteratorAlloc(list,PS_LIST_HEAD,true); 140 136 141 pthread_mutex_init(&(list->lock), NULL) 142 ; 137 pthread_mutex_init(&(list->p_lock), NULL); 143 138 144 139 if (data != NULL) { … … 322 317 psListElem* elem = psAlloc(sizeof(psListElem)); 323 318 324 pthread_mutex_lock(&list->lock) 325 ; 319 pthread_mutex_lock(&list->p_lock); 326 320 327 321 // set the new list element's attributes … … 359 353 } 360 354 361 pthread_mutex_unlock(&list->lock) 362 ; 355 pthread_mutex_unlock(&list->p_lock); 363 356 364 357 return true; … … 397 390 psListElem* elem = psAlloc(sizeof(psListElem)); 398 391 399 pthread_mutex_lock(&list->lock) 400 ; 392 pthread_mutex_lock(&list->p_lock); 401 393 402 394 // set the new list element's attributes … … 434 426 } 435 427 436 pthread_mutex_unlock(&list->lock) 437 ; 428 pthread_mutex_unlock(&list->p_lock); 438 429 439 430 return true; -
trunk/psLib/src/types/psList.h
r4898 r5174 7 7 * @ingroup LinkedList 8 8 * 9 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 8-30 01:14:13$9 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-29 01:15:38 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 60 60 ///< others are user-level iterators created by psListIteratorAlloc. 61 61 62 pthread_mutex_t lock;///< mutex to lock a node during changes63 //void *lock; ///< Optional lock for thread safety62 pthread_mutex_t p_lock; ///< mutex to lock a node during changes 63 void *lock; ///< Optional lock for thread safety 64 64 } 65 65 psList; … … 75 75 typedef struct 76 76 { 77 psList* list; ///< List iterator to works on78 psListElem* cursor; ///< current cursor position79 bool offEnd; ///< Iterator off the end?80 long index; ///< the index number in the list81 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? 82 82 } 83 83 psListIterator; -
trunk/psLib/src/types/psMetadata.h
r5136 r5174 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.6 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09-2 6 21:13:26$13 * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-29 01:15:38 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 136 136 ; 137 137 138 139 138 /** Checks the type of a particular pointer. 140 139 * -
trunk/psLib/src/types/psMetadataConfig.c
r5136 r5174 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.4 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-09-2 6 21:13:26$12 * @version $Revision: 1.47 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-29 01:15:38 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 57 57 /** Maximum size of a string */ 58 58 #define MAX_STRING_LENGTH 256 59 #define MAXSTR 2 5659 #define MAXSTR 2256 60 60 61 61 … … 1228 1228 psString newString = NULL; 1229 1229 psString newStr = NULL; 1230 char mdString[ 2048];1230 char mdString[16000]; 1231 1231 psMetadataItem *item = NULL; 1232 1232 psMetadataIterator *iter = psMetadataIteratorAlloc(md, PS_LIST_HEAD, NULL); … … 1242 1242 while ( (item = psMetadataGetAndIncrement(iter)) ) { 1243 1243 type = item->type; 1244 if ( type == PS_DATA_STRING) 1244 if ( type == PS_DATA_STRING) { 1245 1245 type = PS_DATA_STRING; 1246 if ( type == PS_DATA_VECTOR) 1246 } 1247 if ( type == PS_DATA_VECTOR) { 1247 1248 type = PS_DATA_VECTOR; 1248 if ( type == PS_DATA_TIME) 1249 } 1250 if ( type == PS_DATA_TIME) { 1249 1251 type = PS_DATA_TIME; 1250 if ( item->type == PS_DATA_METADATA) 1252 } 1253 if ( item->type == PS_DATA_METADATA) { 1251 1254 type = PS_DATA_METADATA; 1255 } 1256 if (item == NULL) { 1257 type = PS_DATA_UNKNOWN; 1258 } 1252 1259 1253 1260 switch (type) { … … 1455 1462 } 1456 1463 } 1457 newString = psStringNCopy(mdString, 2048);1464 newString = psStringNCopy(mdString, 16000); 1458 1465 psFree(iter); 1459 1466 return newString;
Note:
See TracChangeset
for help on using the changeset viewer.
