Moved the expensive part of token termination onto a worker thread.

The effect is that the OnLogout event is quick and consistent. There is
no noticeable difference (at the ms level) between this OnLogout
implementation and not doing anything in the OnLogout handler. File
system handles are still closed synchronously so a race condition does
not exist with ui.conf killing processes with open handles.

BUG=chromium-os:29933
TEST=Ran all unit tests.
     Ran platform_Pkcs11Init* autotests.
     Tested timing by manually unloading with active keys.
     Manually verified that chapsd does not get killed on logout.

Change-Id: I8f73b15aeb4691232b890cfb1a3a26b870788fdb
2 files changed
tree: c0935212e56b545d1678973453416fe87bd1155c
  1. LICENSE
  2. Makefile
  3. OWNERS
  4. README
  5. attributes.cc
  6. attributes.h
  7. attributes.proto
  8. chaps.cc
  9. chaps.h
  10. chaps_adaptor.cc
  11. chaps_adaptor.h
  12. chaps_client.cc
  13. chaps_event_generator.cc
  14. chaps_factory.h
  15. chaps_factory_impl.cc
  16. chaps_factory_impl.h
  17. chaps_factory_mock.cc
  18. chaps_factory_mock.h
  19. chaps_interface.h
  20. chaps_interface.xml
  21. chaps_proxy.cc
  22. chaps_proxy.h
  23. chaps_proxy_mock.cc
  24. chaps_proxy_mock.h
  25. chaps_service.cc
  26. chaps_service.h
  27. chaps_service_redirect.cc
  28. chaps_service_redirect.h
  29. chaps_service_test.cc
  30. chaps_test.cc
  31. chaps_utility.cc
  32. chaps_utility.h
  33. chapsd.cc
  34. chapsd.conf
  35. chapsd_test.cc
  36. common.mk
  37. handle_generator.h
  38. handle_generator_mock.h
  39. login_event_client.cc
  40. login_event_client.h
  41. login_event_listener.h
  42. object.h
  43. object_impl.cc
  44. object_impl.h
  45. object_importer.h
  46. object_importer_mock.cc
  47. object_importer_mock.h
  48. object_mock.cc
  49. object_mock.h
  50. object_policy.h
  51. object_policy_cert.cc
  52. object_policy_cert.h
  53. object_policy_common.cc
  54. object_policy_common.h
  55. object_policy_data.cc
  56. object_policy_data.h
  57. object_policy_key.cc
  58. object_policy_key.h
  59. object_policy_mock.cc
  60. object_policy_mock.h
  61. object_policy_private_key.cc
  62. object_policy_private_key.h
  63. object_policy_public_key.cc
  64. object_policy_public_key.h
  65. object_policy_secret_key.cc
  66. object_policy_secret_key.h
  67. object_policy_test.cc
  68. object_pool.h
  69. object_pool_impl.cc
  70. object_pool_impl.h
  71. object_pool_mock.cc
  72. object_pool_mock.h
  73. object_pool_test.cc
  74. object_store.h
  75. object_store_fake.h
  76. object_store_impl.cc
  77. object_store_impl.h
  78. object_store_mock.cc
  79. object_store_mock.h
  80. object_store_test.cc
  81. object_test.cc
  82. opencryptoki_importer.cc
  83. opencryptoki_importer.h
  84. opencryptoki_importer_test.cc
  85. opencryptoki_sample_token.tgz
  86. org.chromium.Chaps.conf
  87. org.chromium.Chaps.service
  88. p11_replay.cc
  89. pkcs11/
  90. session.h
  91. session_impl.cc
  92. session_impl.h
  93. session_mock.cc
  94. session_mock.h
  95. session_test.cc
  96. slot_manager.h
  97. slot_manager_impl.cc
  98. slot_manager_impl.h
  99. slot_manager_mock.cc
  100. slot_manager_mock.h
  101. slot_manager_test.cc
  102. tpm_utility.h
  103. tpm_utility_impl.cc
  104. tpm_utility_impl.h
  105. tpm_utility_mock.cc
  106. tpm_utility_mock.h
  107. tpm_utility_test.cc