scd: Simplify saving application context.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 4 Dec 2015 05:13:23 +0000 (14:13 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 15 Dec 2015 00:49:29 +0000 (09:49 +0900)
commit520c85ed94fa2033e0d2ca5f9a0244b7b290b958
tree381ce239e369968054f9205655900e3fa4e08248
parent9934889415d47f691344499972a0b879cf90ff96
scd: Simplify saving application context.

* scd/app.c (lock_table): Remove LAST_APP field.
(lock_reader, app_dump_state, application_notify_card_reset)
(release_application): Follow the change.
(check_conflict): New.
(check_application_conflict): Lock the slot and call check_conflict.
(select_application): Call check_conflict and not use LAST_APP.

--

We don't need LAST_APP field but just keep the application context by
APP field.  Since we have a reference counter, it is possible if we
can deallocate or not.

(backport of commit 9639af5f16a7ed908cbce2415330b9fcd88edc90)
scd/app.c