diff options
author | Mike Buland <eichlan@xagasoft.com> | 2015-08-25 21:47:49 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2015-08-25 21:47:49 +0000 |
commit | 6d5135aa23f2ae12d953ceab1c1d01e003a55be1 (patch) | |
tree | 75ad30019a6780bb76e8adc0c744b4a747193f40 /src/unstable/cachebase.h | |
parent | 04f68d35183bb98c04f09b077e650cf90ff72139 (diff) | |
download | libbu++-6d5135aa23f2ae12d953ceab1c1d01e003a55be1.tar.gz libbu++-6d5135aa23f2ae12d953ceab1c1d01e003a55be1.tar.bz2 libbu++-6d5135aa23f2ae12d953ceab1c1d01e003a55be1.tar.xz libbu++-6d5135aa23f2ae12d953ceab1c1d01e003a55be1.zip |
Added more lock/unlock features to the cache Lockers. That...was a weird
sentence, but it's true. Also, oddly enough, Lockers aren't thread-safe, but
they shouldn't ever have to be. Figure that one out!
Diffstat (limited to '')
-rw-r--r-- | src/unstable/cachebase.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/unstable/cachebase.h b/src/unstable/cachebase.h index d5b4382..2e0f24f 100644 --- a/src/unstable/cachebase.h +++ b/src/unstable/cachebase.h | |||
@@ -351,6 +351,14 @@ namespace Bu | |||
351 | bLocked = false; | 351 | bLocked = false; |
352 | } | 352 | } |
353 | 353 | ||
354 | void lock() | ||
355 | { | ||
356 | if( bLocked ) | ||
357 | return; | ||
358 | rPtr.lock(); | ||
359 | bLocked = true; | ||
360 | } | ||
361 | |||
354 | private: | 362 | private: |
355 | MyType &rPtr; | 363 | MyType &rPtr; |
356 | bool bLocked; | 364 | bool bLocked; |