Currently, I have been trying to debug the following problem: unloader
function does not run.

Scenario #1: there is the BSF4Rexx.dll which contains a loader and an
unloader function. If rexx.exe starts a Rexx program that then loads the
BSF4Rexx.dll, the loader runs and when the Rexx program ends, the
unloader runs.

Scenario #2: there is the BSF4Rexx.dll which contains a loader and an
unloader function. Java loads the BSF4Rexx.dll, not rexx.exe. Then Java
creates a Rexx interpreter instance, which starts a Rexx program that
then loads the BSF4Rexx.dll, the loader runs, *but* when the Rexx
program ends, the unloader does not run! Looking at the different code
paths to scenario #1, then the following can be observed:

    * a Rexx instnace is created using the following option (the package
      definition defines the loader and unloader function), the loader
      function executes:

          RexxLibraryPackage pkg;
          pkg.registeredName   = "BSF4Rexx";
          pkg.table            = &bsf_package_entry;

          options[0].optionName= REGISTER_LIBRARY;
          options[0].option    = (void *) &pkg; //
      &bsf_external_functions;  //
          options[1].optionName=NULL;

      No AttachThread() nor DetachTrhead() are invoked.

    * a Rexx script is sent from Java via JNI and the above Rexx
      interpreter instance is used to execute it using "NewRoutine()"
      and then "CallRoutine()"; here an AttachThread() and a matching
      DetachThread() is carried out.

    * Before the Java program ends, it will use JNI to Terminate() the
      Rexx interpreter instance that got created and employed above. No
      AttachThread() nor DetachTrhead() are invoked.

Going over the code-path of scenario #2 to the best of my knowledge, no
Rexx thread exists that would be executing, hence I would expect that
the unloader function would run.

Any ideas or hints what might be the cause in scenario #2 that the
unloader function does not run?

---rony

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to