system-pclub / GCatch

Statically Detecting Go Concurrency Bugs
GNU General Public License v2.0
435 stars 40 forks source link

Define structs of channel and Locker, which will be used later in alias analysis and constraint generation #4

Closed lzhfromustc closed 4 years ago

lzhfromustc commented 4 years ago

This PR creates two new files that define the structs of Channel and Locker Take Channel as an example, we define a primitive Channel, and an interface ChanOp. The interface ChanOp has concrete implementations like ChanSend and ChanRecv. We also define some special channels like ChanTimer, which will be used for some APIs in time library.

Note: one implementation of ChanOp is ChOp. It doesn't have concrete meaning, and it is used because otherwise, we need to write concrete methods for every one of ChanSend, ChanRecv, ChanClose... This is because Go doesn't support generics

songlh commented 4 years ago

Please remove the interface design. completely unnecessary. please stop trying interface or generic any more. I think this is completely a waste of time.