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

CSharp_顾朗哲_无21 #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Grange007
Copy link

No description provided.

bool isAtReady = true;

public bool Start(long needTime) {
object lockobject = new object();
Copy link
Owner

Choose a reason for hiding this comment

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

锁应当作为字段,否则每次调用方法都是对一个全新的锁进行占用,这毫无意义

public bool TrySet0() {
object lockobject = new object();
lock (lockobject) {
if (!isAtReady) {
Copy link
Owner

Choose a reason for hiding this comment

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

应当“使未完成的进度条清零”

public void Set0() {
object lockobject = new object();
lock (lockobject) {
finishedTime = 0;
Copy link
Owner

Choose a reason for hiding this comment

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

finishedTime 的意义是?
isAtReady 应当更新

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