services: Get rid of unnecessary locks.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-03-02 07:21:51 +01:00 committed by Alexandre Julliard
parent 34fd639801
commit 4931f5fbe9
2 changed files with 0 additions and 8 deletions

View File

@ -274,7 +274,6 @@ DWORD __cdecl svcctl_GetServiceDisplayNameW(
{
LPCWSTR name;
int len;
service_lock(entry);
name = get_display_name(entry);
len = strlenW(name);
if (len <= *cchBufSize)
@ -285,7 +284,6 @@ DWORD __cdecl svcctl_GetServiceDisplayNameW(
else
err = ERROR_INSUFFICIENT_BUFFER;
*cchBufSize = len;
service_unlock(entry);
}
else
err = ERROR_SERVICE_DOES_NOT_EXIST;
@ -319,7 +317,6 @@ DWORD __cdecl svcctl_GetServiceKeyNameW(
if (entry != NULL)
{
int len;
service_lock(entry);
len = strlenW(entry->name);
if (len <= *cchBufSize)
{
@ -329,7 +326,6 @@ DWORD __cdecl svcctl_GetServiceKeyNameW(
else
err = ERROR_INSUFFICIENT_BUFFER;
*cchBufSize = len;
service_unlock(entry);
}
else
err = ERROR_SERVICE_DOES_NOT_EXIST;
@ -539,9 +535,7 @@ static DWORD create_serviceW(
if ((found = scmdatabase_find_service(manager->db, lpServiceName)))
{
service_lock(found);
err = is_marked_for_delete(found) ? ERROR_SERVICE_MARKED_FOR_DELETE : ERROR_SERVICE_EXISTS;
service_unlock(found);
scmdatabase_unlock(manager->db);
free_service_entry(entry);
return err;

View File

@ -435,9 +435,7 @@ void release_service(struct service_entry *service)
if (InterlockedDecrement(&service->ref_count) == 0 && is_marked_for_delete(service))
{
scmdatabase_lock(service->db);
service_lock(service);
scmdatabase_remove_service(service->db, service);
service_unlock(service);
scmdatabase_unlock(service->db);
free_service_entry(service);
}