1 parent d05be4c commit 78a3d9bCopy full SHA for 78a3d9b
1 file changed
magicmime.go
@@ -124,7 +124,10 @@ const (
124
// NewDecoder creates a detector that uses libmagic. It initializes
125
// the opens the magicmime database with the specified flags. Upon
126
// success users are expected to call Close on the returned Decoder
127
-// when it is no longer needed.
+// when it is no longer needed. Access to the magicmime
128
+// database is not synchronized; the magicmime database file-descriptor
129
+// is referenced through a global variable. Add mutex Lock/Unlock around
130
+// the magicmime functions if using multiple goroutines.
131
func NewDecoder(flags Flag) (*Decoder, error) {
132
db := C.magic_open(C.int(0))
133
if db == nil {
0 commit comments