Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next #948

Merged
merged 23 commits into from Oct 22, 2019
Merged

Next #948

Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3f79d0f
sync margo
DisposaBoy Nov 29, 2018
479c279
sync margo
DisposaBoy Dec 7, 2018
9bddf10
don't crash the ipc when decoding invalid utf-8
DisposaBoy Dec 7, 2018
367fb98
update .travis.yml to list the versions that are actually supported
DisposaBoy Jun 26, 2019
1fa209d
sync margo
DisposaBoy Jun 26, 2019
e715195
tweak for better readability
DisposaBoy Jun 26, 2019
1227ae2
recognise go.mod and go.sum files and increase MAX_VIEW_SIZE to 8MiB
DisposaBoy Jun 26, 2019
8011586
use custom Mutex for locking to make it easier to debug
DisposaBoy Jun 26, 2019
96d6e2c
don't trigger an action while the view is loading
DisposaBoy Jun 26, 2019
7c65941
prep CHANGELOG for next release
DisposaBoy Jun 26, 2019
a3913e8
sync margo
DisposaBoy Jul 8, 2019
466c0f8
reduce the spacing between status items now that they have a prefix
DisposaBoy Jul 8, 2019
36ce43c
set MARGO_AGENT_GOBIN when building margo.exe to avoid side-effects o…
DisposaBoy Jul 8, 2019
ef8ef81
update SUPPORT docs
DisposaBoy Jul 8, 2019
2453428
update CHANGELOG for next realease
DisposaBoy Jul 8, 2019
05819e7
sync margo
DisposaBoy Jul 9, 2019
4775407
update next CHANGELOG
DisposaBoy Jul 9, 2019
28f0ff7
sync margo
DisposaBoy Jul 22, 2019
e26e125
improve 9o filename regexp to reduce cases of highlighting things tha…
DisposaBoy Jul 22, 2019
975d5cc
Update CHANGELOG.md
DisposaBoy Oct 22, 2019
481880a
Update about.py
DisposaBoy Oct 22, 2019
7b71bf0
Update README.md
DisposaBoy Oct 22, 2019
b38ad9c
Update README.md
DisposaBoy Oct 22, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

use custom Mutex for locking to make it easier to debug

  • Loading branch information
DisposaBoy committed Jun 26, 2019
commit 80115868f530c4dbb12de873f81ebe511385433b
@@ -1,7 +1,7 @@
from . import _dbg
from . import gs, gsq, sh
from .margo_agent import MargoAgent
from .margo_common import OutputLogger, TokenCounter
from .margo_common import OutputLogger, TokenCounter, Mutex
from .margo_render import render
from .margo_state import State, actions, client_actions, Config, _view_scope_lang, view_is_9o, MgView
from base64 import b64decode
@@ -10,7 +10,6 @@
import os
import shlex
import sublime
import threading
import time
import webbrowser

@@ -34,11 +33,11 @@ def __init__(self):
}
self.file_ids = []
self._hud_state = {}
self._hud_state_lock = threading.Lock()
self._hud_state_lock = Mutex(name='margo.MargoSingleton._hud_state_lock')
self.hud_name = 'GoSublime/HUD'
self.hud_id = self.hud_name.replace('/','-').lower()
self._views = {}
self._view_lock = threading.Lock()
self._view_lock = Mutex(name='margo.MargoSingleton._view_lock')
self._gopath = ''

def _sync_settings(self):
@@ -1,6 +1,6 @@
from . import _dbg
from . import sh, gs, gsq
from .margo_common import TokenCounter, OutputLogger, Chan
from .margo_common import TokenCounter, OutputLogger, Chan, Mutex
from .margo_state import State, make_props, actions
from datetime import datetime
import os
@@ -40,7 +40,7 @@ def __init__(self, mg):
_, self.domain = mg.agent_tokens.next()
self.cookies = TokenCounter('%s,request' % self.domain)
self.proc = None
self.lock = threading.Lock()
self.lock = Mutex(name='margo.MargoAgent.lock')
self.out = OutputLogger(self.domain, parent=mg.out)
self.global_handlers = {}
self.req_handlers = {}
@@ -64,7 +64,7 @@ def __init__(self, mg):
}
gs.mkdirp(self.data_dir)

self._acts_lock = threading.Lock()
self._acts_lock = Mutex(name='margo.MargoAgent._acts_lock')
self._acts = []

def __del__(self):
@@ -341,7 +341,7 @@ def __init__(self, agent, actions, cb=None, view=None):
self.cb = cb
self.props = make_props(view=view)
self.rs = DEFAULT_RESPONSE
self.lock = threading.Lock()
self.lock = Mutex(name='margo.AgentReq.lock')
self.ev = threading.Event()
self.view = view

@@ -5,6 +5,23 @@
import sublime
import time

class Mutex(object):
def __init__(self, *, name=''):
self.name = name
self.lck = threading.Lock()

def __enter__(self):
self.lock()

def __exit__(self, type, value, traceback):
self.unlock()

def lock(self):
self.lck.acquire(True)

def unlock(self):
self.lck.release()

class OutputLogger(object):
def __init__(self, domain, parent=None):
self.domain = domain
@@ -39,7 +56,7 @@ def next(self):

class Chan(object):
def __init__(self, *, zero=None, discard=None):
self.lock = threading.Lock()
self.lock = Mutex(name='margo.Chan')
self.ev = threading.Event()
self.dq = deque([], maxlen=discard)
self.closed = False
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.