#368 New RexxThreadContext API

APIs (29)

I would like to propose a new API. The signature would look like this.

RexxThreadContext getRexxThreadContext(int thrdId);

When supplied with the thread ID it would return the associated RexxThreadContext. This API would allow classic Rexx APIs (exits, subcommands) to access the new oo APIs available in ooRexx 4.0. In fact, the proposed API could be made simpler by eliminating the thread ID argument and having the API use the caller's thread ID for the search.

Once the caller has the RexxThreadContext it could use all the new oo APIs. This would allow the classic subcommand environment to manipulate things like arrays, etc.


  • Rick McGuire

    Rick McGuire - 2009-08-17

    If all you wish is a thread context for the current thread to allow you to manipulate objects, then AttachThread() already gives you that capability. If you wish something larger, such as suddenly getting a new-form RexxCallContext or RexxExitContext created for the current call out context, that really is not a good idea, because it's really not a good idea to retroactively create the appropriate call context or do the necessary type enforcement.

  • David Ashley

    David Ashley - 2009-08-17

    The problem is that to use attachThread you need a RexxInstance, and the classic subcommand interface has no way of determining the current RexxInstance. The only way I can think of to associate the classic subcommand environment to the oo interfaces is via the thread ID. But I am open to other ideas if you have them.

  • David Ashley

    David Ashley - 2009-08-27

    I am going to close this RFE. The solution to this problem was right in front of me. It just took me a while to figure it out.

    When you wrap a classic subcommand environment in a ooRexx package all the package initialization routines have a RexxThreadContext pointer as an argument. If the classic subcommand environment want/sneeds access to the ooRexx oo APIs then it can save this pointer and then use it later when the subcommand gets invoked thus giving it full access to those APIs.

  • Rick McGuire

    Rick McGuire - 2009-08-27

    Note, you should not reuse the RexxThreadContext pointer for these types of callbacks. However, you can obtain the RexxInstance pointer and use that to perform an AttachThread operation on that instance.



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks