2525#include "erl_nif.h"
2626#include "erl_nif_priv.h"
2727#include "globalcontext.h"
28+ #include "scheduler.h"
2829#include "utils.h"
2930
3031static uint32_t cb_read_resource = 0 ;
@@ -87,7 +88,7 @@ void test_resource()
8788
8889 assert (cb_read_resource == 0 );
8990
90- context_destroy (ctx );
91+ scheduler_terminate (ctx );
9192 assert (cb_read_resource == 42 );
9293 cb_read_resource = 0 ;
9394
@@ -116,7 +117,7 @@ void test_resource_destroyed_with_global()
116117 uint32_t * resource = (uint32_t * ) ptr ;
117118 * resource = 42 ;
118119
119- context_destroy (ctx );
120+ scheduler_terminate (ctx );
120121 assert (cb_read_resource == 0 );
121122
122123 globalcontext_destroy (glb );
@@ -163,7 +164,7 @@ void test_resource_keep_release()
163164
164165 cb_read_resource = 0 ;
165166
166- context_destroy (ctx );
167+ scheduler_terminate (ctx );
167168 globalcontext_destroy (glb );
168169
169170 assert (cb_read_resource == 0 );
@@ -205,7 +206,7 @@ void test_resource_monitor()
205206 assert (monitor_result == 0 );
206207 assert (cb_read_resource == 0 );
207208
208- context_destroy (ctx );
209+ scheduler_terminate (ctx );
209210 assert (cb_read_resource == 42 );
210211 assert (down_pid == pid );
211212 assert (enif_compare_monitors (& mon , & down_mon ) == 0 );
@@ -223,7 +224,7 @@ void test_resource_monitor()
223224 monitor_result = enif_demonitor_process (& env , ptr , & mon );
224225 assert (monitor_result == 0 );
225226
226- context_destroy (ctx );
227+ scheduler_terminate (ctx );
227228 assert (cb_read_resource == 0 );
228229 assert (down_pid == 0 );
229230
@@ -243,7 +244,7 @@ void test_resource_monitor()
243244
244245 cb_read_resource = 0 ;
245246
246- context_destroy (ctx );
247+ scheduler_terminate (ctx );
247248 assert (cb_read_resource == 0 );
248249 assert (down_pid == 0 );
249250
0 commit comments