Have equal number of sc_lock and sc_unlock loglines to aid debugging locking.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3064 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2006-11-28 11:54:51 +00:00
parent 66f3d64e5a
commit ff5f55417f
1 changed files with 2 additions and 1 deletions

View File

@ -282,13 +282,14 @@ int sc_lock(sc_card_t *card)
{
int r = 0, r2 = 0;
SC_FUNC_CALLED(card->ctx, 3);
if (card == NULL)
return SC_ERROR_INVALID_ARGUMENTS;
r = sc_mutex_lock(card->ctx, card->mutex);
if (r != SC_SUCCESS)
return r;
if (card->lock_count == 0) {
SC_FUNC_CALLED(card->ctx, 3);
if (card->reader->ops->lock != NULL)
r = card->reader->ops->lock(card->reader, card->slot);
if (r == 0)