ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

ActivityManager.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 
39 #include "RexxCore.h"
40 #include "RexxActivity.hpp"
41 #include "RexxActivation.hpp"
42 #include "DirectoryClass.hpp"
43 #include "ActivityManager.hpp"
44 #include "Interpreter.hpp"
45 #include "ProtectedObject.hpp"
46 #include "InterpreterInstance.hpp"
47 #include "RexxNativeActivation.hpp"
48 #include "SysActivity.hpp"
49 
50 // The currently active activity.
52 
53 // this is a volatile variable used to ensure instruction ordering
54 volatile bool ActivityManager::sentinel = false;
55 
56 // available activities we can reuse
58 
59 // table of all activities
61 
62 std::deque<RexxActivity *>ActivityManager::waitingActivities; // queue of waiting activities
63 
64 // process shutting down flag
66 
67 // number of active interpreter instances in this process
69 
70 // global lock for the interpreter
72 
73 // the termination complete semaphore
75 
80 {
84 }
85 
86 void ActivityManager::live(size_t liveMark)
87 /******************************************************************************/
88 /* NOTE: we do not mark the UninitTables. MEMORY will request the table */
89 /* and mark it for us. This is so that it can determine if there are */
90 /* any objects that a "dead" and need uninit run. Activity will run the */
91 /* UNINIT, but we let Garbage Collection, handle detection/etc. */
92 /* NOTE: we also do not mark the subClasses table. This will be managed */
93 /* by memory so that we can reclaim classes once all of the instances have */
94 /* also been reclaimed. */
95 /******************************************************************************/
96 {
99 }
100 
102 /******************************************************************************/
103 /* NOTE: we do not mark the UninitTables. MEMORY will request the table */
104 /* and mark it for us. This is so that it can determine if there are */
105 /* any objects that a "dead" and need uninit run. Activity will run the */
106 /* UNINIT, but we let Garbage Collection, handle detection/etc. */
107 /* The subClasses table is only marked during a save image, so that the */
108 /* classes will still have the proper subclass definitions. */
109 /******************************************************************************/
110 {
111  if (!memoryObject.savingImage())
112  {
115  }
116 }
117 
118 
125 void ActivityManager::addWaitingActivity(RexxActivity *waitingAct, bool release )
126 {
127  ResourceSection lock; // need the control block locks
128 
129  // nobody waiting yet? If the release flag is true, we already have the
130  // kernel lock, but nobody is waiting. In theory, this can't really
131  // happen, but we can return immediately if that is true.
132  if (waitingActivities.empty())
133  {
134  // we're done if we already have the lock and the queue is empty.
135  if (release)
136  {
137  return;
138  }
139  // add to the end
140  waitingActivities.push_back(waitingAct);
141  // this will ensure this happens before the lock is released
142  sentinel = false;
143  // we should end up getting the lock immediately, but you never know.
144  lock.release(); // release the lock now
145  }
146  else
147  {
148  // add to the end
149  waitingActivities.push_back(waitingAct);
150  // this will ensure this happens before the lock is released
151  sentinel = false;
152  // we're going to wait until posted, so make sure the run semaphore is cleared
153  waitingAct->clearWait();
154  sentinel = true;
155  lock.release(); // release the lock now
156  sentinel = false;
157  // if we are the current kernel semaphore owner, time to release this
158  // so other waiters can
159  if (release)
160  {
161  unlockKernel();
162  }
163  SysActivity::yield(); // yield the thread
164  waitingAct->waitForDispatch(); // wait for this thread to get dispatched again
165  }
166 
167  sentinel = true;
168  lockKernel(); // get the kernel lock now
169  // belt and braces. it is possible the dispatcher was
170  // reentered on the same thread, in which case we have an
171  // earlier stack frame waiting on the same semaphore. Clear it so it
172  // get get reposted later.
173  waitingAct->clearWait();
174  sentinel = false;
175  lock.reacquire(); // get the resource lock back
176  sentinel = false; // another memory barrier
177 
178  // We only get dispatched if we end up at the front of the queue again,
179  // so just pop the front element.
180  waitingActivities.pop_front();
181  sentinel = true;
182  // if there's something else in the queue, then post the run semaphore of
183  // the head element so that it wakes up next and starts waiting on the
184  // run semaphore
185  if (hasWaiters())
186  {
187  waitingActivities.front()->postDispatch();
188  }
189  // the setting of the sentinel variables acts as a memory barrier to
190  // ensure that the assignment of currentActivitiy occurs precisely at this point.
191  sentinel = false;
192  currentActivity = waitingAct; /* set new current activity */
193  sentinel = true;
194  /* and new active settings */
196 }
197 
198 
204 {
205  //TODO: more stuff should be moved into here.
207 }
208 
214 {
215  ResourceSection lock;
216  interpreterInstances--; /* reduce the active count */
217  if (interpreterInstances == 0) /* down to nothing? */
218  {
219  /* force termination */
220  shutdown();
221  }
222 }
223 
224 
229 {
230  processTerminating = true;
231  /* Make sure we wake up server */
232  /* Make sure all free Activities */
233  /* get the terminate message */
234  /* done after uninit calls. incas */
235  /* uninits needed some. */
237 }
238 
239 
254 RexxActivation *ActivityManager::newActivation(RexxActivity *activity, RoutineClass *routine, RexxCode *code, RexxString *calltype, RexxString *environment, int context)
255 {
256  // in heavily multithreaded environments, the activation cache is a source for race conditions
257  // that can lead to crashes. Just unconditionally create a new actvation
258  return new RexxActivation(activity, routine, code, calltype, environment, context);
259 }
260 
261 
275 {
276  // in heavily multithreaded environments, the activation cache is a source for race conditions
277  // that can lead to crashes. Just unconditionally create a new actvation
278  return new RexxActivation(activity, parent, code, context);
279 }
280 
281 
293 {
294  // in heavily multithreaded environments, the activation cache is a source for race conditions
295  // that can lead to crashes. Just unconditionally create a new actvation
296  return new RexxActivation(activity, method, code);
297 }
298 
299 
309 {
310  // in heavily multithreaded environments, the activation cache is a source for race conditions
311  // that can lead to crashes. Just unconditionally create a new actvation
312  return new RexxNativeActivation(activity, parent);
313 }
314 
315 
324 {
325  // in heavily multithreaded environments, the activation cache is a source for race conditions
326  // that can lead to crashes. Just unconditionally create a new actvation
327  return new RexxNativeActivation(activity);
328 }
329 
330 
337 {
338  ResourceSection lock; // lock the control information
339  /* try to get one from the free table*/
341  if (activity == OREF_NULL)
342  {
343  lock.release(); // release lock while creating new activity
344  /* Create a new activity object */
345  activity = new RexxActivity(true);
346  lock.reacquire(); // need this back again
347  /* Add this activity to the table of */
348  /* in use activities and the global */
349  /* table */
350  allActivities->append((RexxObject *)activity);
351  }
352  else
353  {
354  /* We are able to reuse an activity, */
355  /* so just re-initialize it. */
356  activity->reset();
357  }
358  return activity; /* return the activity */
359 }
360 
361 
368 {
369  // create an activity object without creating a new thread
370  RexxActivity *activity = new RexxActivity(false);
371  ResourceSection lock; // lock the control information
372  /* Add this activity to the table of */
373  /* in use activities and the global */
374  /* table */
375  allActivities->append((RexxObject *)activity);
376  return activity; /* return the activity */
377 }
378 
379 
390 {
391  // create a new activity with the same priority as the parent
392  RexxActivity *activity = createNewActivity();
393  // copy any needed settings from the parent
394  activity->inheritSettings(parent);
395  return activity;
396 }
397 
398 
400 /******************************************************************************/
401 /* Function: see if there are any Uninit messages need to be send before */
402 /* the process goes away. */
403 /******************************************************************************/
404 {
406  while (activity != OREF_NULL)
407  {
408  // terminate this thread
409  activity->terminatePoolActivity();
411  }
412 }
413 
414 
427 {
428  // are we shutting down or have too many threads in the pool?
430  {
431  // have the activity clean up its resources.
432  activity->cleanupActivityResources();
433 
434  // remove this from the activity list
435  allActivities->removeItem((RexxObject *)activity);
436  return false;
437  }
438  else
439  {
440  // just add this to the available list
441  availableActivities->append((RexxObject *)activity);
442  return true; // this was successfully pooled
443  }
444 }
445 
446 
448  thread_id_t thread_id, /* target thread id */
449  RexxString * description ) /* description to use */
450 /******************************************************************************/
451 /* Function: Flip on a bit in a target activities top activation */
452 /******************************************************************************/
453 {
454  ResourceSection lock;
455  // locate the activity associated with this thread_id. If not found, return
456  // a failure.
457  RexxActivity *activity = findActivity(thread_id);
458  if (activity != OREF_NULL)
459  {
460  return activity->halt(description);
461  }
462  return false; // this was a failure
463 }
464 
465 
467  thread_id_t thread_id, /* target thread id */
468  bool on_or_off ) /* trace on/off flag */
469 /******************************************************************************/
470 /* Function: Flip on a bit in a target activities top activation */
471 /******************************************************************************/
472 {
473  ResourceSection lock;
474  // locate the activity associated with this thread_id. If not found, return
475  // a failure.
476  RexxActivity *activity = findActivity(thread_id);
477  if (activity != OREF_NULL)
478  {
479  return activity->setTrace(on_or_off);
480  }
481  return false; // this was a failure
482 }
483 
484 
486 /******************************************************************************/
487 /* Function: Signal an activation to yield control */
488 /******************************************************************************/
489 {
490  ResourceSection lock;
491 
493  if (activity != OREF_NULL)
494  {
495  activity->yield();
496  }
497 }
498 
499 
501 /******************************************************************************/
502 /* Function: Locate the activity associated with a thread */
503 /******************************************************************************/
504 {
505  // this is a critical section
506  ResourceSection lock;
507 
508  // NB: New activities are pushed on to the end, so it's prudent to search
509  // from the list end toward the front of the list. Also, this ensures we
510  // will find the toplevel activity nested on a given thread first.
511  for (size_t listIndex = allActivities->lastIndex();
512  listIndex != LIST_END;
513  listIndex = allActivities->previousIndex(listIndex) )
514  {
515  RexxActivity *activity = (RexxActivity *)allActivities->getValue(listIndex);
516  // this should never happen, but we never return suspended threads
517  if (activity->isThread(threadId) && !activity->isSuspended())
518  {
519  return activity;
520  }
521  }
522  return OREF_NULL;
523 }
524 
525 
527 /******************************************************************************/
528 /* Function: Locate the activity associated with a thread */
529 /******************************************************************************/
530 {
532 }
533 
534 
535 void ActivityManager::exit(int retcode)
536 /******************************************************************************/
537 /* Function: Really shut down--this exits the process */
538 /******************************************************************************/
539 {
540  ::exit(retcode);
541 }
542 
544 /******************************************************************************/
545 /* Function: Request access to the kernel */
546 /******************************************************************************/
547 {
548  kernelSemaphore.request(); /* just request the semaphore */
549 }
550 
552 /******************************************************************************/
553 /* Function: Release the kernel access */
554 /******************************************************************************/
555 {
556  // the use of the sentinel variables will ensure that the assignment of
557  // current activity occurs BEFORE the kernel semaphore is released.
558  sentinel = false;
559  currentActivity = OREF_NULL; /* no current activation */
560  sentinel = true;
561  kernelSemaphore.release(); /* release the kernel semaphore */
562 }
563 
568 {
570  // this needs to be created and set
573 }
574 
579 {
582 }
583 
584 
594 {
595  // don't give this up if we have activities in the
596  // dispatch queue
597  if (waitingActivities.empty())
598  {
600  }
601  return false;
602 }
603 
604 
612 /******************************************************************************/
613 /* Function: Return access to an activity previously obtained from */
614 /* getActivity(). This will handle activity nesting and also */
615 /* release the kernel semaphore. */
616 /******************************************************************************/
617 {
618  // START OF CRITICAL SECTION
619  {
620  ResourceSection lock;
621  // and also remove from the global list
622  allActivities->removeItem((RexxObject *)activityObject);
623  // if we ended up pushing an old activity down when we attached this
624  // thread, then we need to restore the old thread to active state.
625  RexxActivity *oldActivity = activityObject->getNestedActivity();
626  if (oldActivity != OREF_NULL)
627  {
628  oldActivity->setSuspended(false);
629  }
630  // cleanup any system resources this activity might own
631  activityObject->cleanupActivityResources();
632  }
633 }
634 
635 
643 {
644  // START OF CRITICAL SECTION
645  {
646  ResourceSection lock; // this is a critical section
647  // and also remove from the global list
648  allActivities->removeItem((RexxObject *)activityObject);
649  // cleanup any system resources this activity might own
650  activityObject->cleanupActivityResources();
651  /* Are we terminating? */
652  if (processTerminating && allActivities->items() == 0)
653  {
654  // notify any waiters that we're clear
655  postTermination();
656  }
657  }
658 }
659 
660 
667 {
668  // it's possible we already have an activity active for this thread. That
669  // most likely occurs in nested RexxStart() calls. Get that activity first,
670  // and if we have one, we'll need to push this down.
671  RexxActivity *oldActivity = findActivity();
672 
673  // we need to lock the kernel to have access to the memory manager to
674  // create this activity.
675  lockKernel();
676  /* Get a new activity object. */
677  RexxActivity *activityObject = createCurrentActivity();
678  unlockKernel(); /* release kernel semaphore */
679  // mark this as the root activity for an interpreter instance. Some operations
680  // are only permitted from the root threads.
681  activityObject->setInterpreterRoot();
682 
683  // Do we have a nested interpreter call occurring on the same thread? We need to
684  // mark the old activity as suspended, and chain this to the new activity.
685  if (oldActivity != OREF_NULL)
686  {
687  oldActivity->setSuspended(true);
688  // this pushes this down the stack.
689  activityObject->setNestedActivity(oldActivity);
690  }
691 
692  // now we need to have this activity become the kernel owner.
693  activityObject->requestAccess();
694  // this will help ensure that the code after the request access call
695  // is only executed after access acquired.
696  sentinel = true;
697 
698  activityObject->activate(); // let the activity know it's in use, potentially nested
699  // belt-and-braces. Make sure the current activity is explicitly set to
700  // this activity before leaving.
701  currentActivity = activityObject;
702  return activityObject;
703 }
704 
705 
711 {
712  // detach this from the instance. This will also reactivate
713  // and nested activity that's been pushed down.
714  activity->detachInstance();
715  // make sure we release any system resources used by this activity, such as the semaphores
716  activity->cleanupActivityResources();
717 
718  ResourceSection lock; // need the control block locks
719  // remove this from the activity list so it will never get
720  // picked up again.
721  allActivities->removeItem((RexxObject *)activity);
722 }
723 
724 
734 {
735  // it's possible we already have an activity active for this thread. That
736  // most likely occurs in nested RexxStart() calls.
737  RexxActivity *oldActivity = findActivity();
738  // we have an activity created for this thread already. The interpreter instance
739  // should already have handled the case of an attach for an already attached thread.
740  // so we're going to have a new activity to create, and potentially an existing one to
741  // suspend
742  // we need to lock the kernel to have access to the memory manager to
743  // create this activity.
744  lockKernel();
745  RexxActivity *activityObject = createCurrentActivity();
746  // Do we have a nested interpreter call occurring on the same thread? We need to
747  // mark the old activity as suspended, and chain this to the new activity.
748  if (oldActivity != OREF_NULL)
749  {
750  oldActivity->setSuspended(true);
751  // this pushes this down the stack.
752  activityObject->setNestedActivity(oldActivity);
753  }
754 
755  unlockKernel(); /* release kernel semaphore */
756 
757  // now we need to have this activity become the kernel owner.
758  activityObject->requestAccess();
759  // this will help ensure that the code after the request access call
760  // is only executed after access acquired.
761  sentinel = true;
762  // belt-and-braces. Make sure the current activity is explicitly set to
763  // this activity before leaving.
764  currentActivity = activityObject;
765  return activityObject;
766 }
767 
768 
777 {
778  // it's possible we already have an activity active for this thread. That
779  // most likely occurs in nested RexxStart() calls.
780  RexxActivity *activityObject = findActivity();
781  if (activityObject == OREF_NULL) /* Nope, 1st time through here. */
782  {
783  // this is an error....not sure how to handle this.
784  return OREF_NULL;
785  }
786  // go acquire the kernel lock and take care of nesting
787  activityObject->enterCurrentThread();
788  return activityObject; // Return the activity for thread
789 }
790 
791 
799 {
800  // if we have waiting activities, then let one of them
801  // in next.
802  if (hasWaiters())
803  {
804  addWaitingActivity(activity, true);
805  }
806 }
807 
808 
818 {
819  if (currentActivity == OREF_NULL)
820  {
821  return TheNilObject;
822  }
823  return currentActivity->getLocalEnvironment(name);
824 }
825 
826 
833 {
834  if (currentActivity == OREF_NULL)
835  {
836  return OREF_NULL;
837  }
838  return currentActivity->getLocal();
839 }
840 
841 
850 {
851  // default to no instance
854  // if not reentering on an existing thread, we create a new instance
855  // temporarily to service this request. Many functions will
856  // not make sense called this way.
857  if (activity == OREF_NULL)
858  {
859  // Get an instance. This also gives the root activity of the instance
860  // the kernel lock.
863 
864  }
866 }
867 
868 
874 {
876  if (instance != OREF_NULL)
877  {
878  // terminate the instance
879  instance->terminate();
880  }
881 }
882 
883 
895 {
896  self->createLocalReference(o);
897  return o;
898 }
899 
ActivityManager::newActivation
static RexxActivation * newActivation(RexxActivity *activity, RoutineClass *routine, RexxCode *code, RexxString *calltype, RexxString *environment, int context)
Definition: ActivityManager.cpp:254
ActivityManager::createCurrentActivity
static RexxActivity * createCurrentActivity()
Definition: ActivityManager.cpp:367
SysMutex::create
void create()
Definition: SysSemaphore.cpp:238
ActivityManager::postTermination
static void postTermination()
Definition: ActivityManager.hpp:97
SysSemaphore
Definition: SysSemaphore.hpp:52
ActivityManager::kernelSemaphore
static SysMutex kernelSemaphore
Definition: ActivityManager.hpp:123
SysSemaphore::reset
void reset()
Definition: SysSemaphore.cpp:213
RexxActivity::getLocal
RexxDirectory * getLocal()
Definition: RexxActivity.cpp:1980
NativeContextBlock::protect
RexxObject * protect(RexxObject *o)
Definition: ActivityManager.cpp:894
ActivityManager::relinquish
static void relinquish(RexxActivity *activity)
Definition: ActivityManager.cpp:798
ActivityManager::shutdown
static void shutdown()
Definition: ActivityManager.cpp:228
ActivityManager::allActivities
static RexxList * allActivities
Definition: ActivityManager.hpp:118
memory_mark_general
#define memory_mark_general(oref)
Definition: RexxMemory.hpp:437
memoryObject
RexxMemory memoryObject
Definition: RexxMemory.cpp:84
ActivityManager::terminateInterpreter
static void terminateInterpreter()
Definition: ActivityManager.cpp:213
RexxActivation.hpp
ActivityManager::getActivity
static RexxActivity * getActivity()
Definition: ActivityManager.cpp:776
RexxActivity::enterCurrentThread
void enterCurrentThread()
Definition: RexxActivity.cpp:201
ActivityManager::hasWaiters
static bool hasWaiters()
Definition: ActivityManager.hpp:56
RexxActivity::exitCurrentThread
void exitCurrentThread()
Definition: RexxActivity.cpp:184
ActivityManager::availableActivities
static RexxList * availableActivities
Definition: ActivityManager.hpp:116
RexxActivity::isSuspended
bool isSuspended()
Definition: RexxActivity.hpp:261
ActivityManager::MAX_THREAD_POOL_SIZE
Definition: ActivityManager.hpp:110
RoutineClass
Definition: RoutineClass.hpp:49
RexxMemory::savingImage
bool savingImage()
Definition: RexxMemory.hpp:214
RexxActivity::halt
bool halt(RexxString *)
Definition: RexxActivity.cpp:1886
ActivityManager.hpp
RexxNativeActivation.hpp
SysActivity::yield
static void yield()
Definition: SysActivity.hpp:88
RexxCode
Definition: RexxCode.hpp:58
ActivityManager::sentinel
static volatile bool sentinel
Definition: ActivityManager.hpp:125
ActivityManager::init
static void init()
Definition: ActivityManager.cpp:79
ActivityManager::createNewActivity
static RexxActivity * createNewActivity()
Definition: ActivityManager.cpp:336
NativeContextBlock::~NativeContextBlock
~NativeContextBlock()
Definition: ActivityManager.cpp:873
RexxActivity::isThread
bool isThread(thread_id_t id)
Definition: RexxActivity.hpp:215
ActivityManager::createLocks
static void createLocks()
Definition: ActivityManager.cpp:567
ActivityManager::processTerminating
static bool processTerminating
Definition: ActivityManager.hpp:120
RexxActivity::requestAccess
void requestAccess()
Definition: RexxActivity.cpp:1945
ActivityManager::setActivityTrace
static bool setActivityTrace(thread_id_t thread_id, bool on_or_off)
Definition: ActivityManager.cpp:466
ActivityManager::newNativeActivation
static RexxNativeActivation * newNativeActivation(RexxActivity *activity, RexxActivation *parent)
Definition: ActivityManager.cpp:308
ActivityManager::createInterpreter
static void createInterpreter()
Definition: ActivityManager.cpp:203
RexxActivity::setTrace
bool setTrace(bool)
Definition: RexxActivity.cpp:1909
InterpreterInstance::terminate
bool terminate()
Definition: InterpreterInstance.cpp:447
ActivityManager::poolActivity
static bool poolActivity(RexxActivity *activity)
Definition: ActivityManager.cpp:426
RexxList::previousIndex
size_t previousIndex(size_t i)
Definition: ListClass.cpp:829
ResourceSection::reacquire
void reacquire()
Definition: Interpreter.hpp:181
NativeContextBlock::activity
RexxActivity * activity
Definition: ActivityManager.hpp:330
SysMutex::close
void close()
Definition: SysSemaphore.cpp:287
thread_id_t
pthread_t thread_id_t
Definition: rexxapitypes.h:65
RexxActivity::setNestedActivity
void setNestedActivity(RexxActivity *a)
Definition: RexxActivity.hpp:265
Interpreter.hpp
ResourceSection
Definition: Interpreter.hpp:154
RexxActivity::getTopStackFrame
RexxActivationBase * getTopStackFrame()
Definition: RexxActivity.hpp:281
RexxActivity::getNumericSettings
NumericSettings * getNumericSettings()
Definition: RexxActivity.hpp:283
RexxList::lastIndex
size_t lastIndex()
Definition: ListClass.hpp:85
InterpreterInstance::getRootActivity
RexxActivity * getRootActivity()
Definition: InterpreterInstance.hpp:74
RexxActivity::reset
void reset()
Definition: RexxActivity.cpp:278
SysSemaphore::close
void close()
Definition: SysSemaphore.cpp:153
SysSemaphore::create
void create()
Definition: SysSemaphore.cpp:89
ActivityManager::closeLocks
static void closeLocks()
Definition: ActivityManager.cpp:578
ActivityManager::terminationSem
static SysSemaphore terminationSem
Definition: ActivityManager.hpp:124
RexxActivity::yield
void yield()
Definition: RexxActivity.cpp:1865
RexxActivity::inheritSettings
void inheritSettings(RexxActivity *parent)
Definition: RexxActivity.cpp:3121
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
ActivityManager::yieldCurrentActivity
static void yieldCurrentActivity()
Definition: ActivityManager.cpp:485
RexxActivity
Definition: RexxActivity.hpp:127
RexxActivity::waitForDispatch
void waitForDispatch()
Definition: RexxActivity.hpp:289
RexxDirectory
Definition: DirectoryClass.hpp:49
RexxList::append
RexxObject * append(RexxObject *)
Definition: ListClass.cpp:537
ProtectedObject.hpp
Numerics::setCurrentSettings
static void setCurrentSettings(NumericSettings *s)
Definition: Numerics.hpp:112
SysActivity.hpp
ActivityManager::haltActivity
static bool haltActivity(thread_id_t thread_id, RexxString *description)
Definition: ActivityManager.cpp:447
RexxList::getValue
RexxObject * getValue(size_t i)
Definition: ListClass.cpp:275
RexxActivity::setInterpreterRoot
void setInterpreterRoot()
Definition: RexxActivity.hpp:264
ActivityManager::returnRootActivity
static void returnRootActivity(RexxActivity *activity)
Definition: ActivityManager.cpp:710
RexxList::removeItem
RexxObject * removeItem(RexxObject *)
Definition: ListClass.cpp:1022
ActivityManager::waitingActivities
static std::deque< RexxActivity * > waitingActivities
Definition: ActivityManager.hpp:126
SysMutex
Definition: SysSemaphore.hpp:73
SysMutex::request
void request()
Definition: SysSemaphore.hpp:81
NativeContextBlock::instance
InterpreterInstance * instance
Definition: ActivityManager.hpp:331
ActivityManager::getRootActivity
static RexxActivity * getRootActivity()
Definition: ActivityManager.cpp:666
ActivityManager::addWaitingActivity
static void addWaitingActivity(RexxActivity *a, bool release)
Definition: ActivityManager.cpp:125
ActivityManager::liveGeneral
static void liveGeneral(int reason)
Definition: ActivityManager.cpp:101
ActivityManager::lockKernelImmediate
static bool lockKernelImmediate()
Definition: ActivityManager.cpp:593
ActivityManager::attachThread
static RexxActivity * attachThread()
Definition: ActivityManager.cpp:733
ResourceSection::release
void release()
Definition: Interpreter.hpp:171
RexxActivity::clearWait
void clearWait()
Definition: RexxActivity.hpp:290
memory_mark
#define memory_mark(oref)
Definition: RexxMemory.hpp:436
SysMutex::requestImmediate
bool requestImmediate()
Definition: SysSemaphore.hpp:83
ActivityManager::live
static void live(size_t)
Definition: ActivityManager.cpp:86
RexxActivity::setSuspended
void setSuspended(bool s)
Definition: RexxActivity.hpp:262
RexxActivation
Definition: RexxActivation.hpp:156
SysActivity::queryThreadID
static thread_id_t queryThreadID()
Definition: SysActivity.cpp:127
ActivityManager::unlockKernel
static void unlockKernel()
Definition: ActivityManager.cpp:551
ActivityManager::interpreterInstances
static size_t interpreterInstances
Definition: ActivityManager.hpp:121
ActivityManager::getLocal
static RexxDirectory * getLocal()
Definition: ActivityManager.cpp:832
new_list
RexxList * new_list()
Definition: ListClass.hpp:147
RexxNativeActivation
Definition: RexxNativeActivation.hpp:62
TheNilObject
#define TheNilObject
Definition: RexxCore.h:180
ActivityManager::currentActivity
static RexxActivity *volatile currentActivity
Definition: ActivityManager.hpp:95
RexxActivity::cleanupActivityResources
void cleanupActivityResources()
Definition: RexxActivity.cpp:172
ActivityManager::exit
static void exit(int retcode)
Definition: ActivityManager.cpp:535
ActivityManager::returnActivity
static void returnActivity(RexxActivity *)
Definition: ActivityManager.cpp:611
ActivityManager::lockKernel
static void lockKernel()
Definition: ActivityManager.cpp:543
RexxActivity::getLocalEnvironment
RexxObject * getLocalEnvironment(RexxString *name)
Definition: RexxActivity.cpp:3200
Interpreter::createInterpreterInstance
static InterpreterInstance * createInterpreterInstance()
Definition: Interpreter.hpp:95
RexxActivity.hpp
RexxActivity::detachInstance
void detachInstance()
Definition: RexxActivity.cpp:1723
LIST_END
#define LIST_END
Definition: ListClass.hpp:60
ActivityManager::findActivity
static RexxActivity * findActivity()
Definition: ActivityManager.cpp:526
ActivityManager::getLocalEnvironment
static RexxObject * getLocalEnvironment(RexxString *name)
Definition: ActivityManager.cpp:817
InterpreterInstance.hpp
RexxCore.h
RexxList
Definition: ListClass.hpp:63
DirectoryClass.hpp
RexxActivity::activate
void activate()
Definition: RexxActivity.hpp:255
RexxActivity::terminatePoolActivity
void terminatePoolActivity()
Definition: RexxActivity.cpp:2999
NativeContextBlock::NativeContextBlock
NativeContextBlock()
Definition: ActivityManager.cpp:849
RexxMethod
Definition: MethodClass.hpp:101
ActivityManager::clearActivityPool
static void clearActivityPool()
Definition: ActivityManager.cpp:399
RexxList::items
size_t items()
Definition: ListClass.hpp:97
RexxList::removeFirstItem
RexxObject * removeFirstItem()
Definition: ListClass.hpp:111
SysMutex::release
void release()
Definition: SysSemaphore.hpp:82
ActivityManager::activityEnded
static void activityEnded(RexxActivity *)
Definition: ActivityManager.cpp:642
RexxObject
Definition: ObjectClass.hpp:311
RexxString
Definition: StringClass.hpp:119