Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
de33ecf4
Commit
de33ecf4
authored
11 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge branch 'stable'
Conflicts: test/box/test_init.lua
parents
b443f554
e81e2842
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lua/init.cc
+20
-0
20 additions, 0 deletions
src/lua/init.cc
test/box/test_init.lua
+8
-0
8 additions, 0 deletions
test/box/test_init.lua
with
28 additions
and
0 deletions
src/lua/init.cc
+
20
−
0
View file @
de33ecf4
...
...
@@ -818,6 +818,13 @@ load_init_script(va_list ap)
{
struct
lua_State
*
L
=
va_arg
(
ap
,
struct
lua_State
*
);
/*
* Return control to tarantool_lua_load_init_script.
* tarantool_lua_load_init_script when will start an auxiliary event
* loop and re-schedule this fiber.
*/
fiber_sleep
(
0.0
);
char
path
[
PATH_MAX
+
1
];
snprintf
(
path
,
PATH_MAX
,
"%s/%s"
,
cfg
.
script_dir
,
TARANTOOL_LUA_INIT_SCRIPT
);
...
...
@@ -835,6 +842,12 @@ load_init_script(va_list ap)
* The file doesn't exist. It's OK, tarantool may
* have no init file.
*/
/*
* Lua script finished. Stop the auxiliary event loop and
* return control back to tarantool_lua_load_init_script.
*/
ev_break
(
EVBREAK_ALL
);
}
/**
...
...
@@ -878,6 +891,13 @@ tarantool_lua_load_init_script(struct lua_State *L)
struct
fiber
*
loader
=
fiber_new
(
TARANTOOL_LUA_INIT_SCRIPT
,
load_init_script
);
fiber_call
(
loader
,
L
);
/*
* Run an auxiliary event loop to re-schedule load_init_script fiber.
* When this fiber finishes, it will call ev_break to stop the loop.
*/
ev_run
(
0
);
/* Outside the startup file require() or ffi are not
* allowed.
*/
...
...
This diff is collapsed.
Click to expand it.
test/box/test_init.lua
+
8
−
0
View file @
de33ecf4
...
...
@@ -33,3 +33,11 @@ box.fiber.resume(fiber)
--
space
:
insert
(
2
,
4
,
8
,
16
)
--
-- A test case for https://github.com/tarantool/tarantool/issues/53
--
assert
(
require
~=
nil
)
box
.
fiber
.
sleep
(
0
.
0
)
assert
(
require
~=
nil
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment