aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-12-08 19:26:14 +0100
committerSverker Eriksson <[email protected]>2016-12-19 19:18:51 +0100
commit387ff8e3347d21e9ca5ad3d8c3a694bc79d38bca (patch)
tree65b38fbe74b5b5e83d0244073f88e56ffdc339d0 /erts/emulator/beam
parent9ffe2d285943b661317cee2b00d779a2e75a3374 (diff)
downloadotp-387ff8e3347d21e9ca5ad3d8c3a694bc79d38bca.tar.gz
otp-387ff8e3347d21e9ca5ad3d8c3a694bc79d38bca.tar.bz2
otp-387ff8e3347d21e9ca5ad3d8c3a694bc79d38bca.zip
Add stop arguments: fd and is_direct_call
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_nif.c5
-rw-r--r--erts/emulator/beam/erl_nif.h16
-rw-r--r--erts/emulator/beam/global.h2
3 files changed, 12 insertions, 11 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 27abba7cfd..4e41944ccb 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -2124,12 +2124,13 @@ static void nif_resource_dtor(Binary* bin)
}
}
-void erts_resource_stop(ErlNifResource* resource)
+void erts_resource_stop(ErlNifResource* resource, ErlNifEvent e,
+ int is_direct_call)
{
struct enif_msg_environment_t msg_env;
ASSERT(resource->type->stop);
pre_nif_noproc(&msg_env, resource->type->owner, NULL);
- resource->type->stop(&msg_env.env, resource->data);
+ resource->type->stop(&msg_env.env, resource->data, e, is_direct_call);
post_nif_noproc(&msg_env);
}
diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h
index bf0f7b1f15..78e0fa1864 100644
--- a/erts/emulator/beam/erl_nif.h
+++ b/erts/emulator/beam/erl_nif.h
@@ -138,18 +138,18 @@ typedef struct
void* ref_bin;
}ErlNifBinary;
-typedef struct {
- void (*dtor)(ErlNifEnv* env, void* obj);
- void (*stop)(ErlNifEnv* env, void* obj); /* at ERL_NIF_SELECT_STOP event */
-} ErlNifResourceTypeInit;
+//#ifndef ERL_SYS_DRV
+typedef int ErlNifEvent; /* An event to be selected on. */
+//#endif
typedef struct enif_resource_type_t ErlNifResourceType;
typedef void ErlNifResourceDtor(ErlNifEnv*, void*);
-typedef void ErlNifResourceStop(ErlNifEnv*, void*);
+typedef void ErlNifResourceStop(ErlNifEnv*, void*, ErlNifEvent, int is_direct_call);
-//#ifndef ERL_SYS_DRV
-typedef int ErlNifEvent; /* An event to be selected on. */
-//#endif
+typedef struct {
+ ErlNifResourceDtor* dtor;
+ ErlNifResourceStop* stop; /* at ERL_NIF_SELECT_STOP event */
+} ErlNifResourceTypeInit;
typedef enum
{
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 5c5693a315..2decb56544 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -95,7 +95,7 @@ extern void erts_pre_dirty_nif(ErtsSchedulerData *,
struct erl_module_nif*);
extern void erts_post_dirty_nif(struct enif_environment_t* env);
#endif
-extern void erts_resource_stop(ErlNifResource* resource);
+extern void erts_resource_stop(ErlNifResource*, ErlNifEvent, int is_direct_call);
extern Eterm erts_nif_taints(Process* p);
extern void erts_print_nif_taints(fmtfn_t to, void* to_arg);
void erts_unload_nif(struct erl_module_nif* nif);