scd: Serialize opening device by select_application.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 28 Nov 2018 05:59:44 +0000 (14:59 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 28 Nov 2018 05:59:44 +0000 (14:59 +0900)
commit47106ac435e891ced67f0ad9bb6b2ee12098c880
treeba103456127440c583b48b13efbf24997311c8ab
parent483e63f9b5faead819ddd28308902ef43bf298ab
scd: Serialize opening device by select_application.

* scd/app.c (app_new_register): Don't lock APP_LIST_LOCK here.
(select_application): Lock with APP_LIST_LOCK earlier.

--

What we want to do here is to serialize the call of
select_application.  In the old code, it was possible
that a call of select_application was blocked internally,
and then another call of select_application entered.

We can have a dedicated lock for call of select_application,
but it is easier to re-use APP_LIST_LOCK.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/app.c