Skip to content
Browse files

Merge pull request #25 from basho/jdm-make-permanent

Lock spidermonkey_drv.so in memory so NSPR thread cleanup code runs.
  • Loading branch information...
2 parents d4e2fd0 + 11557da commit 605369a96348824f6d233f5602c12b34d575af33 @jonmeredith jonmeredith committed Jun 18, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 c_src/spidermonkey_drv.c
View
7 c_src/spidermonkey_drv.c
@@ -193,6 +193,13 @@ static ErlDrvData start(ErlDrvPort port, char *cmd) {
retval->atom_ok = driver_mk_atom((char *) "ok");
retval->atom_error = driver_mk_atom((char *) "error");
retval->atom_unknown_cmd = driver_mk_atom((char *) "unknown_command");
+
+ /* Lock the driver in memory. NSPR registers some thread cleanup
+ ** code in _pt_thread_death on the async thread pool which
+ ** gets called after spidermonkey_drv.so is unloaded on R15B
+ */
+ driver_lock_driver(port);
+
return (ErlDrvData) retval;
}

0 comments on commit 605369a

Please sign in to comment.
Something went wrong with that request. Please try again.