You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.7 KiB
78 lines
1.7 KiB
//+---------------------------------------------------------------------------
|
|
//
|
|
// Microsoft Windows
|
|
// Copyright (C) Microsoft Corporation, 1992 - 1993.
|
|
//
|
|
// File: task.cxx
|
|
//
|
|
// Contents: CTask class implementation.
|
|
//
|
|
// Classes: CTask
|
|
//
|
|
// Functions: None.
|
|
//
|
|
// History: 25-Oct-95 MarkBl Created
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#include "..\pch\headers.hxx"
|
|
#pragma hdrstop
|
|
#include "debug.hxx"
|
|
|
|
#include "task.hxx"
|
|
|
|
//+---------------------------------------------------------------------------
|
|
//
|
|
// Method: CTask::AddRef
|
|
//
|
|
// Synopsis: Increment the task reference count.
|
|
//
|
|
// Arguments: None.
|
|
//
|
|
// Returns: ULONG reference count.
|
|
//
|
|
// Notes: None.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
ULONG
|
|
CTask::AddRef(void)
|
|
{
|
|
ULONG ulTmp = InterlockedIncrement((LONG *)&_cReferences);
|
|
|
|
schDebugOut((DEB_USER3,
|
|
"CTask::AddRef(0x%x) _cReferences(%d)\n",
|
|
this,
|
|
ulTmp));
|
|
|
|
return(ulTmp);
|
|
}
|
|
|
|
//+---------------------------------------------------------------------------
|
|
//
|
|
// Method: CTask::Release
|
|
//
|
|
// Synopsis: Decrement the task reference count.
|
|
//
|
|
// Arguments: None.
|
|
//
|
|
// Returns: ULONG reference count.
|
|
//
|
|
// Notes: None.
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
ULONG
|
|
CTask::Release(void)
|
|
{
|
|
ULONG ulTmp = InterlockedDecrement((LONG *)&_cReferences);
|
|
|
|
schDebugOut((DEB_USER3,
|
|
"CTask::Release(0x%x) _cReferences(%d)\n",
|
|
this,
|
|
ulTmp));
|
|
|
|
if (ulTmp == 0)
|
|
{
|
|
delete this;
|
|
}
|
|
return(ulTmp);
|
|
}
|