Changeset 109 for trunk/desktop


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

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

Location:
trunk/desktop
Files:
2 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
  • trunk/desktop/idl/wpobject.idl

    r104 r109  
    3838#include <nomobj.idl>
    3939
     40#include "wpnativetypes.idl"
     41
    4042interface WPObject : NOMObject
    4143{
     
    6062  void wpUnInitData();
    6163  gpointer wpOpen(in gpointer ptrReserved, in unsigned long ulView, in gpointer ptrParams);
     64  void wpLockObject();
     65  boolean wpUnlockObject();
     66  boolean wpObjectIsLocked();
    6267
    6368  NOMOVERRIDE(nomInit);
    6469  NOMOVERRIDE(nomUninit);
     70  NOMINSTANCEVAR(gint iLockCounter);
    6571};
    6672
    6773#endif
     74
     75
     76
     77
     78
Note: See TracChangeset for help on using the changeset viewer.