package middleware

import (
	"game-driver/internal/common"
	"game-driver/leaf"
)

// DeviceLock 设备锁中间件
func DeviceLock(d *common.Device) leaf.HandlerFunc {
	return func(c *leaf.Context) {
		d.Lock()
		defer d.Unlock()

		c.Next()
	}
}
