aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL/LuaSL_threads.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/LuaSL/LuaSL_threads.h')
-rw-r--r--src/LuaSL/LuaSL_threads.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/LuaSL/LuaSL_threads.h b/src/LuaSL/LuaSL_threads.h
new file mode 100644
index 0000000..9a11b5c
--- /dev/null
+++ b/src/LuaSL/LuaSL_threads.h
@@ -0,0 +1,54 @@
1/* This code is heavily based on luaproc.
2 *
3 * The luaproc copyright notice and license is -
4
5 ***************************************************
6
7Copyright 2008 Alexandre Skyrme, Noemi Rodriguez, Roberto Ierusalimschy
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26
27 ****************************************************
28 *
29 * Additions and changes Copyright 2012 by David Seikel, using the above license.
30 */
31
32#ifndef __LUASL_THREADS_H__
33#define __LUASL_THREADS_H__
34
35/* scheduler function return constants */
36#define LUAPROC_SCHED_OK 0
37#define LUAPROC_SCHED_SOCKET_ERROR -1
38#define LUAPROC_SCHED_SETSOCKOPT_ERROR -2
39#define LUAPROC_SCHED_BIND_ERROR -3
40#define LUAPROC_SCHED_LISTEN_ERROR -4
41#define LUAPROC_SCHED_FORK_ERROR -5
42#define LUAPROC_SCHED_PTHREAD_ERROR -6
43#define LUAPROC_SCHED_INIT_ERROR -7
44
45
46void luaprocInit(void);
47int sched_create_worker(void);
48void newProc(const char *code, int file, script *lp);
49const char *sendToChannel(gameGlobals *ourGlobals, const char *SID, const char *message);
50
51/* join all worker threads and exit */
52void sched_join_workerthreads(void);
53
54#endif