diff options
| author | pengxuanzheng <[email protected]> | 2020-08-28 18:44:14 +0800 |
|---|---|---|
| committer | pengxuanzheng <[email protected]> | 2020-08-28 18:44:14 +0800 |
| commit | 4121cc7cb0fb7d2d3230e0eaa42637cab96e5c8f (patch) | |
| tree | f00602da9026d72c24688c6403a5128bc0c99d49 /example/multithread.cpp | |
| parent | 03b064f1f31853c79c4cde8213ed27a572ef3674 (diff) | |
修改输入参数tsg为TSG
Diffstat (limited to 'example/multithread.cpp')
| -rw-r--r-- | example/multithread.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/example/multithread.cpp b/example/multithread.cpp index 26b45ec..48dd227 100644 --- a/example/multithread.cpp +++ b/example/multithread.cpp @@ -34,6 +34,7 @@ typedef struct lua_data_s{ typedef struct{ lua_data_t data; int thread_id; + tsg_lua_handle lua; }userdata_t; @@ -178,6 +179,7 @@ int main(int argc, char *argv[]) { int thread_num; pthread_t thread[MAX_THREAD_NUM] = {0}; + tsg_lua_handle lua[MAX_THREAD_NUM] = {0}; int thread_sum; int ch, i; char buf[1024]; @@ -252,6 +254,8 @@ int main(int argc, char *argv[]) data->data_len = buf_len; data->data[buf_len] = thread_num; data->data_len++; + lua[i] = tsg_lua_vm_create(); + data->lua = lua[i]; pthread_create(&thread[thread_num], NULL, lua_function, (void *)&userdata[thread_num]); } |
