Skip to content

Commit 0718d09

Browse files
joeybloggsjoeybloggs
authored andcommitted
add check to reuse the current RWMutex if it already exists.
1 parent e3c48b2 commit 0718d09

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##LARS
22
<img align="right" src="https://raw.githubusercontent.com/go-playground/lars/master/examples/README/test.gif">
3-
![Project status](https://img.shields.io/badge/version-2.4-green.svg)
3+
![Project status](https://img.shields.io/badge/version-2.4.1-green.svg)
44
[![Build Status](https://semaphoreci.com/api/v1/projects/4351aa2d-2f94-40be-a6ef-85c248490378/679708/badge.svg)](https://semaphoreci.com/joeybloggs/lars)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/lars/badge.svg?branch=master)](https://coveralls.io/github/go-playground/lars?branch=master)
66
[![Go Report Card](https://goreportcard.com/badge/go-playground/lars)](https://goreportcard.com/report/go-playground/lars)

context.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ func (c *Ctx) ParseMultipartForm(maxMemory int64) error {
182182
func (c *Ctx) Set(key string, value interface{}) {
183183

184184
if c.store == nil {
185-
c.m = new(sync.RWMutex)
185+
186+
if c.m == nil {
187+
c.m = new(sync.RWMutex)
188+
}
189+
186190
c.m.Lock()
187191
c.store = make(store)
188192
} else {

0 commit comments

Comments
 (0)