You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: library/lualink/globals.lua
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,3 +8,18 @@ server = {}
8
8
9
9
---@typeScheduler
10
10
scheduler= {}
11
+
12
+
13
+
--- Ensures that only one thread at a time can access a method or block of code, keeping shared data safe in multithreaded programs.
14
+
--- @paramlockjava.lang.Object
15
+
--- @paramfuncfunction
16
+
functionsynchronized(lock, func) end
17
+
18
+
--- Ensures that only one thread at a time can access a method or block of code, keeping shared data safe in multithreaded programs. This will use the main Lua state as the lock
19
+
--- @paramfuncfunction
20
+
functionsynchronized(func) end
21
+
22
+
--- Let's you try-catch Java exceptions thrown when called from Lua
0 commit comments