Changeset 180 for trunk/include


Ignore:
Timestamp:
03/14/10 16:02:38 (15 years ago)
Author:
tim
Message:

Added locks to make transactions on REGFI_FILE objects thread safe

Added initial version of a threading smoke test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/regfi.h

    r178 r180  
    6969#include <unistd.h>
    7070#include <iconv.h>
     71#include <pthread.h>
    7172
    7273#include "byteorder.h"
     
    674675  REGFI_RAW_FILE* cb;
    675676
     677  /* Mutex for all cb access.  This is done to prevent one thread from moving
     678   * the file offset while another thread is in the middle of a multi-read
     679   * parsing transaction */
     680  pthread_mutex_t* cb_lock;
     681
    676682  /* For sanity checking (not part of the registry header) */
    677683  uint32_t file_length;
     
    680686  range_list* hbins;
    681687
     688  /* Multiple read access allowed, write access is exclusive */
     689  pthread_rwlock_t* hbins_lock;
     690
    682691  /* SK record cached since they're repeatedly reused */
    683692  lru_cache* sk_cache;
     693
     694  /* Need exclusive access for LRUs, since lookups make changes */
     695  pthread_mutex_t* sk_lock;
    684696
    685697  /* Error/warning/info messages returned by lower layer functions */
Note: See TracChangeset for help on using the changeset viewer.