Ignore:
Timestamp:
Nov 25, 2006, 9:43:05 PM (19 years ago)
Author:
cinc
Message:

Implemented wpLockObject(), wpUnlockObject() and wpObjectIsLocked()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/class_c/wpobject.c

    r105 r109  
    8282{
    8383/* WPObjectData* nomThis=WPObjectGetData(nomSelf); */
    84   CORBA_boolean nomRetval;
    8584
    8685  if(!pByte)
     
    112111/* WPObjectData* nomThis=WPObjectGetData(nomSelf); */
    113112
    114 #if 0
    115   /* orbit-idl-c-stubs.c, VoyagerWriteProtoForParentCall line 84 */
     113  _wpUnInitData(nomSelf, ev);
     114
    116115  WPObject_nomUninit_parent(nomSelf,  ev);
    117 #endif
    118116}
    119117
     
    137135  return nomRetval;
    138136}
     137
     138
     139NOM_Scope void NOMLINK impl_WPObject_wpLockObject(WPObject* nomSelf, CORBA_Environment *ev)
     140{
     141  WPObjectData* nomThis=WPObjectGetData(nomSelf);
     142
     143  g_atomic_int_inc(&_iLockCounter);
     144}
     145
     146NOM_Scope CORBA_boolean NOMLINK impl_WPObject_wpUnlockObject(WPObject* nomSelf, CORBA_Environment *ev)
     147{
     148  WPObjectData* nomThis=WPObjectGetData(nomSelf);
     149
     150  /* We return TRUE if the counter is 0 */
     151  if(g_atomic_int_dec_and_test(&_iLockCounter))
     152    {
     153      /* Counter is 0 so the object should go dormant */
     154      return TRUE;
     155    }
     156  return FALSE;
     157}
     158
     159NOM_Scope CORBA_boolean NOMLINK impl_WPObject_wpObjectIsLocked(WPObject* nomSelf, CORBA_Environment *ev)
     160{
     161  WPObjectData* nomThis=WPObjectGetData(nomSelf);
     162
     163  return g_atomic_int_get(&_iLockCounter) && TRUE;
     164}
     165
Note: See TracChangeset for help on using the changeset viewer.