Skip to content

Commit 6bf95fd

Browse files
committed
Fix multi-threaded exit
1 parent a28ef0b commit 6bf95fd

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All changes to the Agoo gem are documented here. Releases follow semantic versioning.
44

5+
## [2.15.12] - 2024-07-28
6+
7+
### Fixed
8+
9+
- When multiple threads are specified and the main thread exits worker
10+
threads not exit as well.
11+
512
## [2.15.11] - 2024-06-04
613

714
### Fixed

example/multi.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ def call(req)
3838
end
3939

4040
# To run this example type the following then go to a browser and enter a URL of localhost:6464/hello.
41-
# ruby hello.rb
41+
# ruby multi.rb

ext/agoo/rserver.c

+6
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,10 @@ wrap_process_loop(void *ptr) {
809809
return Qnil;
810810
}
811811

812+
static void on_exit(VALUE x) {
813+
agoo_server.active = false;
814+
}
815+
812816
/* Document-method: start
813817
*
814818
* call-seq: start()
@@ -908,6 +912,8 @@ rserver_start(VALUE self) {
908912
dsleep(0.05);
909913
}
910914
}
915+
rb_set_end_proc(on_exit, Qnil);
916+
911917
return Qnil;
912918
}
913919

lib/agoo/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
module Agoo
33
# Agoo version.
4-
VERSION = '2.15.11'
4+
VERSION = '2.15.12'
55
end

0 commit comments

Comments
 (0)