• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eaburns / T / 1057
87%
master: 88%

Build:
Build:
LAST BUILD BRANCH: gofont
DEFAULT BRANCH: master
Ran 07 Mar 2016 10:45PM UTC
Jobs 1
Files 9
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1057

push

travis-ci

eaburns
editor: finer-grained locking in the server.

Switch to RWMutex, and release locks early instead of hanging onto them for the entire handler.

Locking is generally straight-forward: rlock something before reading it; wlock something before writing it. However, there is one tricky spot: closing buffers. We need to make sure that we never close a buffer that is about to be used.

Here's how it works:

Routines using buffers call getBufferRLocked or getBufferLocked to get a RLocked or (W)Locked buffer respectively. In both cases, the buffer is found and locked _with the server RLock held_. This means that they were certainly on (and not removed from) from server's buffer's list when they were locked.

Closing a buffer happens in two steps: 1) remove the buffer from the server's buffer list with the server lock held. 2) lock the buffer and close it. When using getBuffer(R)Locked, either the buffer is not found, or it is found and cannot be closed until after the caller unlocks it.

 a. Close 1; Close 2; getBuffer(R)Locked
    getBuffer(R)Locked doesn't find the buffer and returns not found.

 b. getBuffer(R)Locked; Close 1; Close 2
    Close 2 blocks until the returned buffer is (R)Unlocked.

 c. Close 1; getBuffer(R)Locked; Close 2
    The buffer is already removed from from the list before getBuffer(R)Locked, so it will return not found.

2501 of 2656 relevant lines covered (94.16%)

0.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1057.1 (PATH=$HOME/gopath/bin:$PATH) 07 Mar 2016 10:45PM UTC 0
94.16
Travis Job 1057.1
Source Files on build 1057
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1057
  • 5c2f7454 on github
  • Prev Build on editor (#1055)
  • Next Build on editor (#1060)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc