{"ref":"refs/heads/master","commits":[{"author":{"name":"Richard Yang","email":"138c8432f15745cbb99cbe797b087fb3cae9358d@gmail.com"},"sha":"af2c8babf1081e32f38f2c582628fe44c7088b8b","message":"Concurrency IV -- Spinlock, may be used in code that can't sleep\nPinciples for using spinlock\n1. CANNOT sleep when holding a spinlock\n2. disable preemption before holding a apinlock\n   this is done by kernel, the spinlock code itself\n3. disable the interrupt on the local cpu only\n4. hold the spin lock in minimum time\n   If you have a spinlock that can be taken by code that runs\n   in (hardware or software) interrupt context, you must use one\n   of the forms of spin_lock that disables interrupts. Doing\n   otherwise can deadlock the system, sooner or later. If you\n   do not access your lock in a hardware interrupt handler, but\n   you do via software interrupts (in code that runs out of a\n   tasklet, for example, a topic covered in Chapter 7), you can\n   use spin_lock_bh to safely avoid deadlocks while still allowing\n   hardware interrupts to be serviced.","url":"https://api.github.com/repos/WizardDeWhite/ldd3-3.1/commits/af2c8babf1081e32f38f2c582628fe44c7088b8b"}],"head":"af2c8babf1081e32f38f2c582628fe44c7088b8b","size":1,"push_id":51138839}