/[dotgnu-pnet]/pnet/engine/engine.h
ViewVC logotype

Diff of /pnet/engine/engine.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.105 by ktreichel, Tue Aug 23 10:45:52 2005 UTC revision 1.106 by ktreichel, Mon Oct 10 20:03:15 2005 UTC
# Line 166  struct __tagILFinalizationContext Line 166  struct __tagILFinalizationContext
166          ILExecProcess *volatile process;          ILExecProcess *volatile process;
167  };  };
168    
169    #ifdef IL_CONFIG_APPDOMAINS
170    /*
171     * Structure to save the old execution context of an ILExecThread
172     * when a process switch occures.
173     */
174    typedef struct _tagILExecContext ILExecContext;
175    struct _tagILExecContext
176    {
177            /* Pointer to the previous exec context */
178            ILExecContext *prevContext;
179    
180            /* Back-pointer to the process this thread belongs to */
181            ILExecProcess  *process;
182    
183            /* System.Threading.Thread object */
184            ILObject *clrThread;
185    
186            /* Thread-static values for this thread */
187            void              **threadStaticSlots;
188            ILUInt32                threadStaticSlotsUsed;
189    };
190    #endif
191    
192  /* class private data */  /* class private data */
193  typedef struct _tagILClassPrivate ILClassPrivate;  typedef struct _tagILClassPrivate ILClassPrivate;
194    
# Line 393  struct _tagILExecThread Line 416  struct _tagILExecThread
416          int             profilingEnabled;          int             profilingEnabled;
417  #endif  #endif
418    
419    #ifdef IL_CONFIG_APPDOMAINS
420            /* Keep track of the process switches for this thread */
421            /* Needed to clean them up when the thread is destroyed. */
422            ILExecContext *prevContext;
423    #endif
424    
425  #if defined(IL_INTERRUPT_SUPPORTS_ILLEGAL_MEMORY_ACCESS)  #if defined(IL_INTERRUPT_SUPPORTS_ILLEGAL_MEMORY_ACCESS)
426          /* Context for the current interrupt */          /* Context for the current interrupt */
427          ILInterruptContext      interruptContext;          ILInterruptContext      interruptContext;
# Line 489  void ILExecEngineDestroy(ILExecEngine *e Line 518  void ILExecEngineDestroy(ILExecEngine *e
518   * Returns the ILExecEngine or 0 if the function fails.   * Returns the ILExecEngine or 0 if the function fails.
519   */   */
520  ILExecEngine *ILExecEngineCreate();  ILExecEngine *ILExecEngineCreate();
521    
522    /*
523     * Let the thread return from an other ILExecProcess and restore the saved
524     * state.
525     * Returns 0 on failure.
526     */
527    int ILExecThreadReturnToProcess(ILExecThread *thread, ILExecContext *context);
528    
529    /*
530     * Let the thread join an other ILExecProcess and save the current state
531     * in context.
532     * Returns 0 on failure.
533     */
534    int ILExecThreadSwitchToProcess(ILExecThread *thread,
535                                                                    ILExecProcess *process,
536                                                                    ILExecContext *context);
537    
538    #define IL_BEGIN_EXECPROCESS_SWITCH(thread, process) \
539    { \
540            int __processSwitched = 0; \
541            int __error = 0; \
542            ILExecContext __context; \
543            if((thread)->process != (process)) \
544            { \
545                    __processSwitched = ILExecThreadSwitchToProcess((thread), \
546                                                                                                                    (process), \
547                                                                                                                     &__context); \
548            } \
549            if(!__error) \
550            {
551    #define IL_END_EXECPROCESS_SWITCH(thread) \
552                    if(__processSwitched) \
553                    { \
554                            if(!ILExecThreadReturnToProcess((thread), &__context)) \
555                            { \
556                              \
557                            } \
558                    } \
559            } \
560            else \
561            { \
562            } \
563    }
564    #else
565    #define IL_BEGIN_EXECPROCESS_SWITCH(thread, process) \
566    {
567    #define IL_END_EXECPROCESS_SWITCH(thread) \
568    }
569  #endif  #endif
570    
571  /*  /*
# Line 826  ILObject *_ILCustomToObject(ILExecThread Line 903  ILObject *_ILCustomToObject(ILExecThread
903                                                          const char *customCookie, int customCookieLen);                                                          const char *customCookie, int customCookieLen);
904    
905  /*  /*
906     * Get an ILExecThread from the given support thread.
907     */
908    #define _ILExecThreadFromThread(thread) \
909            ((ILExecThread *)(ILThreadGetObject(thread)))
910    
911    /*
912   *      Gets the managed thread object from an engine thread.   *      Gets the managed thread object from an engine thread.
913   */   */
914  ILObject *ILExecThreadGetClrThread(ILExecThread *thread);  ILObject *ILExecThreadGetClrThread(ILExecThread *thread);

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.106

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26