aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-24 18:54:25 +1000
committerDavid Walter Seikel2012-02-24 18:54:25 +1000
commit345898785f651659a96ca7286f2f84737ac3e85c (patch)
treee8b401a49901a348b6794182c897341a73d4cb45
parentStub out the script resetting functions, and refactor the script finding code... (diff)
downloadSledjHamr-345898785f651659a96ca7286f2f84737ac3e85c.zip
SledjHamr-345898785f651659a96ca7286f2f84737ac3e85c.tar.gz
SledjHamr-345898785f651659a96ca7286f2f84737ac3e85c.tar.bz2
SledjHamr-345898785f651659a96ca7286f2f84737ac3e85c.tar.xz
Time to fork luaproc and turn it into an EFL based thing, with tighter integration into LuaSL.
More of this coming soon.
-rwxr-xr-xLuaSL/build.sh2
-rw-r--r--LuaSL/src/LuaSL_threads.c50
-rw-r--r--libraries/luaproc/luaproc.c2
3 files changed, 53 insertions, 1 deletions
diff --git a/LuaSL/build.sh b/LuaSL/build.sh
index dcd243d..39d3a55 100755
--- a/LuaSL/build.sh
+++ b/LuaSL/build.sh
@@ -63,7 +63,7 @@ command="edje_cc $EDJE_FLAGS LuaSL.edc ../LuaSL.edj"
63echo $command 63echo $command
64$command 64$command
65 65
66names="LuaSL_main LuaSL_compile LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer" 66names="LuaSL_main LuaSL_compile LuaSL_threads LuaSL_utilities LuaSL_lexer LuaSL_lemon_yaccer"
67objects="../../libraries/luaproc/channel.o ../../libraries/luaproc/list.o ../../libraries/luaproc/luaproc.o ../../libraries/luaproc/sched.o " 67objects="../../libraries/luaproc/channel.o ../../libraries/luaproc/list.o ../../libraries/luaproc/luaproc.o ../../libraries/luaproc/sched.o "
68for i in $names 68for i in $names
69do 69do
diff --git a/LuaSL/src/LuaSL_threads.c b/LuaSL/src/LuaSL_threads.c
new file mode 100644
index 0000000..eb809b3
--- /dev/null
+++ b/LuaSL/src/LuaSL_threads.c
@@ -0,0 +1,50 @@
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
33/* This is a redesign of luaproc. The design goals and notes -
34 *
35 * Use eina lists instead of the rolled your own lists.
36 * Looks like a FIFO double linked list.
37 * Use ecore threads instead of raw pthreads.
38 * Ecore threads pretty much wraps pthreads on posix, but has Windows support to.
39 * In general use EFL where it is useful.
40 * One fixed unique message channel per script.
41 * Probably one fixed unique message channel per object, which each script in the object shares.
42 * But might be better to handle that C side anyway.
43 * FIFO queue on message channels, seems the C socket queue is not enough.
44 * On the other hand, could just peel messages the socket queue, then shove them on the scripts queue.
45 * Better integration with LuaSL.
46 * Merge the luaproc structure with the script structure.
47 * Merge in the edje Lua code, and keep an eye on that, coz we might want to actually add this to edje Lua in the future.
48 * Use my coding standards, or EFL ones. Pffft.
49 *
50 */
diff --git a/libraries/luaproc/luaproc.c b/libraries/luaproc/luaproc.c
index 7f4b2bb..78c713f 100644
--- a/libraries/luaproc/luaproc.c
+++ b/libraries/luaproc/luaproc.c
@@ -544,6 +544,8 @@ const char *sendToChannelErrors[] =
544 "error scheduling process" 544 "error scheduling process"
545}; 545};
546 546
547// TODO - If these come in too quick, then messages might get lost. Also, in at least one case, it locked up this thread I think.
548
547/* send a message to a lua process */ 549/* send a message to a lua process */
548const char *sendToChannel(const char *chname, const char *message, luaproc *dst, channel *chn) 550const char *sendToChannel(const char *chname, const char *message, luaproc *dst, channel *chn)
549{ 551{