Ignore:
Timestamp:
Aug 24, 1999, 11:20:30 AM (26 years ago)
Author:
sandervl
Message:

One mutex per object type + mutex protection in win32 class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/win32class.cpp

    r606 r655  
    1 /* $Id: win32class.cpp,v 1.6 1999-08-21 12:53:28 sandervl Exp $ */
     1/* $Id: win32class.cpp,v 1.7 1999-08-24 09:20:30 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
     
    120120Win32WndClass *Win32WndClass::FindClass(HINSTANCE hInstance, LPSTR id)
    121121{
     122  enterMutex(OBJTYPE_CLASS);
     123
    122124  Win32WndClass *wndclass = (Win32WndClass *)wndclasses;
    123125
    124   if(wndclass == NULL)  return(NULL);
     126  if(wndclass == NULL) {
     127        leaveMutex(OBJTYPE_CLASS);
     128        return(NULL);
     129  }
    125130
    126131  if(HIWORD(id) != 0) {
    127132//CB: read comment below!
    128133        if(stricmp(wndclass->classNameA, id) == 0 && wndclass->hInstance == hInstance) {
     134                leaveMutex(OBJTYPE_CLASS);
    129135                return(wndclass);
    130136        }
     
    133139                while(wndclass != NULL) {
    134140                        if(stricmp(wndclass->classNameA, id) == 0 && wndclass->hInstance == hInstance) {
     141                                leaveMutex(OBJTYPE_CLASS);
    135142                                return(wndclass);
    136143                        }
     
    143150//CB: need more code to compare instance; convert 0 to exe module handle
    144151        if(wndclass->classAtom == (DWORD)id /*&& wndclass->hInstance == hInstance*/) {
     152                leaveMutex(OBJTYPE_CLASS);
    145153                return(wndclass);
    146154        }
     
    149157                while(wndclass != NULL) {
    150158                        if(wndclass->classAtom == (DWORD)id/* && wndclass->hInstance == hInstance*/) {
    151                                 return(wndclass);
     159                                leaveMutex(OBJTYPE_CLASS);
     160                                return(wndclass);
    152161                        }
    153162                        wndclass = (Win32WndClass *)wndclass->GetNext();
     
    155164        }
    156165  }
     166  leaveMutex(OBJTYPE_CLASS);
    157167  dprintf(("Class %X (inst %X) not found!", id, hInstance));
    158168  return(NULL);
Note: See TracChangeset for help on using the changeset viewer.