Loading libcutils/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ libcutils_nonwindows_sources = [ "android_get_control_file.cpp", "fs.cpp", "hashmap.cpp", "multiuser.cpp", "socket_inaddr_any_server_unix.cpp", "socket_local_client_unix.cpp", Loading Loading @@ -61,7 +62,6 @@ cc_library { "config_utils.cpp", "fs_config.cpp", "canned_fs_config.cpp", "hashmap.cpp", "iosched_policy.cpp", "load_file.cpp", "native_handle.cpp", Loading libcutils/hashmap.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <assert.h> #include <errno.h> #include <cutils/threads.h> #include <pthread.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> Loading @@ -36,7 +36,7 @@ struct Hashmap { size_t bucketCount; int (*hash)(void* key); bool (*equals)(void* keyA, void* keyB); mutex_t lock; pthread_mutex_t lock; size_t size; }; Loading Loading @@ -69,7 +69,7 @@ Hashmap* hashmapCreate(size_t initialCapacity, map->hash = hash; map->equals = equals; mutex_init(&map->lock); pthread_mutex_init(&map->lock, nullptr); return map; } Loading Loading @@ -129,11 +129,11 @@ static void expandIfNecessary(Hashmap* map) { } void hashmapLock(Hashmap* map) { mutex_lock(&map->lock); pthread_mutex_lock(&map->lock); } void hashmapUnlock(Hashmap* map) { mutex_unlock(&map->lock); pthread_mutex_unlock(&map->lock); } void hashmapFree(Hashmap* map) { Loading @@ -147,7 +147,7 @@ void hashmapFree(Hashmap* map) { } } free(map->buckets); mutex_destroy(&map->lock); pthread_mutex_destroy(&map->lock); free(map); } Loading Loading
libcutils/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ libcutils_nonwindows_sources = [ "android_get_control_file.cpp", "fs.cpp", "hashmap.cpp", "multiuser.cpp", "socket_inaddr_any_server_unix.cpp", "socket_local_client_unix.cpp", Loading Loading @@ -61,7 +62,6 @@ cc_library { "config_utils.cpp", "fs_config.cpp", "canned_fs_config.cpp", "hashmap.cpp", "iosched_policy.cpp", "load_file.cpp", "native_handle.cpp", Loading
libcutils/hashmap.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #include <assert.h> #include <errno.h> #include <cutils/threads.h> #include <pthread.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> Loading @@ -36,7 +36,7 @@ struct Hashmap { size_t bucketCount; int (*hash)(void* key); bool (*equals)(void* keyA, void* keyB); mutex_t lock; pthread_mutex_t lock; size_t size; }; Loading Loading @@ -69,7 +69,7 @@ Hashmap* hashmapCreate(size_t initialCapacity, map->hash = hash; map->equals = equals; mutex_init(&map->lock); pthread_mutex_init(&map->lock, nullptr); return map; } Loading Loading @@ -129,11 +129,11 @@ static void expandIfNecessary(Hashmap* map) { } void hashmapLock(Hashmap* map) { mutex_lock(&map->lock); pthread_mutex_lock(&map->lock); } void hashmapUnlock(Hashmap* map) { mutex_unlock(&map->lock); pthread_mutex_unlock(&map->lock); } void hashmapFree(Hashmap* map) { Loading @@ -147,7 +147,7 @@ void hashmapFree(Hashmap* map) { } } free(map->buckets); mutex_destroy(&map->lock); pthread_mutex_destroy(&map->lock); free(map); } Loading