Skip to content

Commit

Permalink
Destroy the memory lock
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Nov 10, 2018
1 parent a724fb2 commit 936e806
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions emu/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void mem_release(struct mem *mem) {
#endif
free(mem->pt);
write_wrunlock(&mem->lock);
wrlock_destroy(&mem->lock);
free(mem);
}
}
Expand Down
1 change: 1 addition & 0 deletions util/sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static inline void wrlock_init(wrlock_t *lock) {
#endif
pthread_rwlock_init(lock, pattr);
}
#define wrlock_destroy(lock) pthread_rwlock_destroy(lock)
#define read_wrlock(lock) pthread_rwlock_rdlock(lock)
#define read_wrunlock(lock) pthread_rwlock_unlock(lock)
#define write_wrlock(lock) pthread_rwlock_wrlock(lock)
Expand Down

0 comments on commit 936e806

Please sign in to comment.