فهرست منبع

Rename rwlock_init to avoid conflict (#3016)

This symbol is too simple to cause conflict with others, such as the RW
spinlock in Linux kernel and NuttX, so rename it to avoid the conflict.
Huang Qi 2 سال پیش
والد
کامیت
915adc433d

+ 1 - 1
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/locking.h

@@ -88,7 +88,7 @@ struct LOCKABLE rwlock {
 };
 
 static inline bool
-rwlock_init(struct rwlock *lock) REQUIRES_UNLOCKED(*lock)
+rwlock_initialize(struct rwlock *lock) REQUIRES_UNLOCKED(*lock)
 {
     return os_rwlock_init(&lock->object) == 0 ? true : false;
 }

+ 2 - 2
core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

@@ -204,7 +204,7 @@ struct fd_prestat {
 bool
 fd_prestats_init(struct fd_prestats *pt)
 {
-    if (!rwlock_init(&pt->lock))
+    if (!rwlock_initialize(&pt->lock))
         return false;
     pt->prestats = NULL;
     pt->size = 0;
@@ -340,7 +340,7 @@ struct fd_entry {
 bool
 fd_table_init(struct fd_table *ft)
 {
-    if (!rwlock_init(&ft->lock))
+    if (!rwlock_initialize(&ft->lock))
         return false;
     ft->entries = NULL;
     ft->size = 0;