- Kotlin Standard Library Cookbook
- Samuel Urbanowicz
- 50字
- 2021-07-23 19:05:57
How to do it...
Let's declare a lock() function with two arguments—an instance of the Lock interface and the function to be invoked after the lock is acquired:
inline fun performHavingLock(lock: Lock, task: () -> Unit) {
lock.lock()
try {
task()
}
finally {
lock.unlock()
}
}
推薦閱讀
- Boost.Asio C++ Network Programming(Second Edition)
- The Modern C++ Challenge
- Vue.js 3.x從入門到精通(視頻教學版)
- MySQL 8 DBA基礎教程
- Designing Hyper-V Solutions
- Learn WebAssembly
- Windows Forensics Cookbook
- Python數據可視化之Matplotlib與Pyecharts實戰
- Mastering Ext JS
- 51單片機C語言開發教程
- Visual Basic程序設計習題與上機實踐
- 計算機應用基礎教程(Windows 7+Office 2010)
- 新印象:解構UI界面設計
- C語言程序設計實訓教程與水平考試指導
- Django 5企業級Web應用開發實戰(視頻教學版)