Skip to content
Snippets Groups Projects
Commit db1d99c2 authored by dg's avatar dg
Browse files

plop

git-svn-id: http://svn.net-core.org/repos/t-engine4@2753 51575b47-30f0-44d4-a5cc-537603b46e54
parent 600da340
No related branches found
No related tags found
No related merge requests found
......@@ -20,10 +20,9 @@
print("TE4Online starting...")
local Client = require "profile-thread.Client"
local c = nil
local c = Client.new()
function step_profile()
if not c then c = Client.new() end
local ok, res = pcall(c.step, c)
if not ok and res then
print("TE4Online error: ", res)
......
......@@ -31,6 +31,7 @@
static profile_type *main_profile;
int thread_profile(void *data)
{
profile_type *profile = (profile_type*)data;
......@@ -49,13 +50,12 @@ int thread_profile(void *data)
if (!luaL_loadfile(L, "/profile-thread/init.lua")) docall(L, 0, 0);
else lua_pop(L, 1);
int request_nbr=0;
while (profile->running)
{
if (!profile->running) break;
// lua_getglobal(L, "step_profile");
// docall(L, 0, 0);
lua_getglobal(L, "step_profile");
docall(L, 0, 0);
}
// Cleanup
......
......@@ -21,12 +21,21 @@
#ifndef _TE4_PROFILE_H_
#define _TE4_PROFILE_H_
struct s_profile_queue_type {
char *payload;
struct s_profile_queue_type *next;
};
typedef struct s_profile_queue_type profile_queue;
typedef struct {
lua_State *L;
SDL_Thread *thread;
int sock;
bool running;
profile_queue *queue_head, queue_tail;
SDL_mutex *lock_queue;
SDL_sem *wait_queue;
} profile_type;
extern void create_profile_thread();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment