{"id":74354,"library":"nebulouslabs-demotemutex","title":"DemoteMutex","description":"Extension to sync.Mutex that allows a writelock to be demoted to a readlock without releasing control to other writelocks.","status":"active","version":"0.0.0-20151003192217-235395f71c40","language":"go","source_language":null,"source_url":"https://gitlab.com/NebulousLabs/demotemutex","tags":["mutex","synchronization","concurrency","lock"],"install":[{"cmd":"go get gitlab.com/NebulousLabs/demotemutex","lang":"bash","label":"Install gitlab.com/NebulousLabs/demotemutex"}],"dependencies":[],"imports":[{"symbol":"demotemutex","correct":"gitlab.com/NebulousLabs/demotemutex"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"gitlab.com/NebulousLabs/demotemutex\"\n)\n\nfunc main() {\n\tvar mu demotemutex.DemoteMutex\n\tmu.Lock()\n\t// ... critical section ...\n\tmu.DemoteToReadLock()\n\t// ... read-only section ...\n\tmu.RUnlock()\n\tfmt.Println(\"Done\")\n}","lang":"go","description":"Demonstrates demoting a write lock to a read lock."},"warnings":[],"env_vars":null,"search_vec":"'allow':6 'concurr':23 'control':17 'demot':11 'demotemutex':1 'extens':2 'lock':24 'mutex':21 'readlock':14 'releas':16 'sync.mutex':4 'synchron':22 'without':15 'writelock':8,20","created_at":"2026-06-17T19:02:30.997366+00:00","updated_at":"2026-06-17T19:02:30.997366+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://gitlab.com/NebulousLabs/demotemutex","github":null,"docs":"https://pkg.go.dev/gitlab.com/NebulousLabs/demotemutex#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}