PK11_EnterSlotMonitor(slot);
if (rwsession != CK_INVALID_SESSION) PK11_EnterSlotMonitor(slot); } if (rwsession == CK_INVALID_SESSION) { PORT_SetError(SEC_ERROR_BAD_DATA); return SECFailure;
PK11_CreateNewObject(PK11SlotInfo *slot, CK_SESSION_HANDLE session,				CK_ATTRIBUTE *theTemplate, int count, 				PRBool token, CK_OBJECT_HANDLE *objectID){	CK_SESSION_HANDLE rwsession;	CK_RV crv;	SECStatus rv = SECSuccess;	rwsession = session;	if (token) {	    rwsession =  PK11_GetRWSession(slot);	} else if (rwsession == CK_INVALID_SESSION) {	    rwsession =  slot->session;	    PK11_EnterSlotMonitor(slot);	}	crv = PK11_GETTAB(slot)->C_CreateObject(rwsession, theTemplate,							count,objectID);	if(crv != CKR_OK) {	    PORT_SetError( PK11_MapError(crv) );	    rv = SECFailure;	}	if (token) {	    PK11_RestoreROSession(slot, rwsession);	} else if (session == CK_INVALID_SESSION) {	    PK11_ExitSlotMonitor(slot);        }	return rv;}