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

question about go use #10

Closed
sunxiao2010n opened this issue Jun 26, 2017 · 1 comment
Closed

question about go use #10

sunxiao2010n opened this issue Jun 26, 2017 · 1 comment

Comments

@sunxiao2010n
Copy link

In file cache.go

if !ok {
t = &CacheTable{
name: table,
items: make(map[interface{}]*CacheItem),
}

  mutex.Lock()
  cache[table] = t
  mutex.Unlock()

}

return t

the assigment function of cache item is

  t = &CacheTable{ ... }

The "t = &CacheTable" seems to be stored at stack , and can not be reentrant after function returns.
How could I understand this ?
Thanks.

@sunxiao2010n
Copy link
Author

t = &CacheTable
means
t = new CacheTable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant