diff options
| author | ruki <[email protected]> | 2020-08-04 23:02:22 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-08-04 23:02:22 +0800 |
| commit | 60a176cb2ae804bea3dfd11dbf8ed2f218fcefdb (patch) | |
| tree | 836036adbec1dd2bcad7f646ac50d47a900a9615 /core/src/xmake/io/filelock_lock.c | |
| parent | df97547270f725cd31352c8c7c483549001f676d (diff) | |
improve filelock
Diffstat (limited to 'core/src/xmake/io/filelock_lock.c')
| -rw-r--r-- | core/src/xmake/io/filelock_lock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/xmake/io/filelock_lock.c b/core/src/xmake/io/filelock_lock.c index 6ffe6c369..415a9a7b5 100644 --- a/core/src/xmake/io/filelock_lock.c +++ b/core/src/xmake/io/filelock_lock.c @@ -55,12 +55,12 @@ tb_int_t xm_io_filelock_lock(lua_State* lua) lua_pop(lua, 1); } - // is user data? - if (!lua_isuserdata(lua, 1)) + // check lock? + if (!xm_lua_ispointer(lua, 1)) return 0; // get lock - tb_filelock_ref_t lock = (tb_filelock_ref_t)lua_touserdata(lua, 1); + tb_filelock_ref_t lock = (tb_filelock_ref_t)xm_lua_topointer(lua, 1); tb_check_return_val(lock, 0); // lock it |
