Skip to content

Update lectures/05-concurrency/lecture.slide#25

Open
thehighestmath wants to merge 4 commits into
slon:mainfrom
thehighestmath:patch-4
Open

Update lectures/05-concurrency/lecture.slide#25
thehighestmath wants to merge 4 commits into
slon:mainfrom
thehighestmath:patch-4

Conversation

@thehighestmath

Copy link
Copy Markdown
Contributor

simplify sum expression
use defer instead of unlock at the function end

thehighestmath and others added 3 commits March 19, 2024 22:50
simplify sum expression
use defer instead of unlock at the function end
@thehighestmath

Copy link
Copy Markdown
Contributor Author

Comment thread lectures/05-concurrency/lecture.slide Outdated
balance = balance + amount
mu.Unlock()
defer mu.Unlock()
balance += amount

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут специально код был так написан :)

@thehighestmath thehighestmath Mar 20, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вернул как было

// Get is concurrency-safe.
func (memo *Memo) Get(key string) (value interface{}, err error) {
memo.mu.Lock()
defer memo.mu.Unlock()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а тут?

@thehighestmath thehighestmath requested a review from slon March 20, 2024 21:45
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

Successfully merging this pull request may close these issues.

2 participants