vmware-archive / go-pmem-transaction

Golang library for using persistent memory
Other
29 stars 5 forks source link

Fix a thread-unsafe datastructure access issue in pmem #14

Closed jerrinsg closed 5 years ago

jerrinsg commented 5 years ago

Certain pmem package functions such as Get(), Delete() etc. were accessing appData[] datastructure in a thread-unsafe manner. This is because these functions used the index returned by exists() after releasing the lock protecting appData. This commit fixes this issue by requiring callers of exist() acquire the lock before calling the function, and releasing it only after the requested operation is completed.

Signed-off-by: Jerrin Shaji George jshajigeorge@vmware.com

jerrinsg commented 5 years ago

Fixes #13